jest VS Cypress

Compare jest vs Cypress and see what are their differences.

Our great sponsors
  • Sonar - Write Clean JavaScript Code. Always.
  • Scout APM - Truly a developer’s best friend
  • Zigi - The context switching struggle is real
  • InfluxDB - Build time-series-based applications quickly and at scale.
jest Cypress
354 143
40,819 41,848
0.6% 1.3%
9.9 9.9
2 days ago 3 days ago
TypeScript JavaScript
MIT License MIT License
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

jest

Posts with mentions or reviews of jest. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2022-12-01.
  • How to Confidently Write Unit Tests using React Testing Library
    7 projects | dev.to | 1 Dec 2022
    We cannot only use the testing library alone, but we also need to install Jest which exposes extensively used global expect function and other things which help to make assertions in our test cases.
  • How I go with react native in late 2022
    33 projects | dev.to | 27 Nov 2022
    There's nothing better than jest and testing-library/react-native in react-native. these tools are suitable for unit and integration tests and they have great community support, utils, and helper functions.
  • Adding Tests for ESM using Jest framework
    2 projects | dev.to | 25 Nov 2022
    Jest is a testing framework for Javascript projects. It ensures that the implemented core functionality of the codebase is not prone to errors by allowing developers to write convenient tests.
  • Nodejs Boilerplate with Typescript and Express
    4 projects | dev.to | 24 Nov 2022
    Jest
  • OSD600 - Telescope - Testing for feed URLs
    4 projects | dev.to | 20 Nov 2022
    However, while running the tests using jest would result in a pass, the expectations would actually fail and the failure result would show up after the tests have already ended. I was confused as to why was happening for a while. Eventually, I noticed this in the file:
  • Auto-run Tests: Test Via Continuous Integration
    2 projects | dev.to | 17 Nov 2022
    There was another repo I tried to add test for, and it uses the same setup as mine. It uses JavaScript and achieve CI via GitHub Action, except that it also run test for version 14.x and 16.x of Node.js. Given both repo use Jest for testing, It's pretty easy to write test for the repo. I needed to spend time to understand the code and then run test coverage and see the existing tests to see what's needed to be done.
  • Making sure izyum is fresh
    3 projects | dev.to | 14 Nov 2022
    Two testing engines are usually used for testing purposes in the ECMAScript world which are jest and mocha. I had previous experience with both of them and to be honest I don't see big differences between them on the basic level. I decided to go with it just because it is more popular and I did use it with typescript before so I did know it had good types of support.
  • Conditional Logging to the JavaScript Console
    4 projects | dev.to | 14 Nov 2022
    The console created by createDebugConsole will not be active in unit tests, so you won't be able to use it to prevent logging in your test environment. If you use jest you can silence console methods with the jest CLI.
  • Ng-News: Episode 22/45
    2 projects | dev.to | 14 Nov 2022
    Jest 29.3 Release Notes
  • JavaScript testing with Jest
    3 projects | dev.to | 13 Nov 2022
    I chose Jest, as it is one of the most used testing frameworks for JavaScript and most of my tool's logic is written in JS. It was developed by Facebook and is open-source. Jest also has CLI option for checking coverage which is very great, it shows which lines of code have been tested and not and prints a beautiful report.

Cypress

Posts with mentions or reviews of Cypress. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2022-11-03.
  • Jag har svårt att hitta jobb.
    5 projects | reddit.com/r/swedishproblems | 3 Nov 2022
    Unit tests eller end to end test tex cypress
  • Extended "run all specs" feature for Cypress 10
    2 projects | dev.to | 7 Oct 2022
    As probably all Cypress fans know already, Cypress 10 was shipped without the "run all tests" feature due to "technical limitations" (they are apparently working on a solution, and here is where you can read all about why they removed it, what are the technical limitations, and all the complaints about it too)
  • Triple combined coverage with Typescript
    2 projects | dev.to | 25 Sep 2022
    import '@cypress/instrument-cra' import {defineConfig} from 'cypress' const codeCoverageTask = require('@bahmutov/cypress-code-coverage/plugin') module.exports = defineConfig({ projectId: '7mypio', experimentalSingleTabRunMode: true, retries: { runMode: 2, openMode: 0, }, env: { API_URL: 'http://localhost:4000/api', }, e2e: { specPattern: 'cypress/e2e/**/*.cy.{js,jsx,ts,tsx}', baseUrl: 'http://localhost:3000', setupNodeEvents(on, config) { return Object.assign({}, config, codeCoverageTask(on, config)) }, }, component: { setupNodeEvents(on, config) { return Object.assign({}, config, codeCoverageTask(on, config)) }, specPattern: 'src/**/*.cy.{js,jsx,ts,tsx}', devServer: { framework: 'create-react-app', bundler: 'webpack', // here are the additional settings from Gleb's instructions webpackConfig: { // workaround to react-scripts 5 issue https://github.com/cypress-io/cypress/issues/22762 devServer: { port: 3001, }, mode: 'development', devtool: false, module: { rules: [ // application and Cypress files are bundled like React components // and instrumented using the babel-plugin-istanbul { test: /\.ts$/, exclude: /node_modules/, use: { loader: 'babel-loader', options: { presets: [ '@babel/preset-env', '@babel/preset-react', '@babel/preset-typescript', ], plugins: [ 'istanbul', ['@babel/plugin-transform-modules-commonjs', {loose: true}], ], }, }, }, ], }, }, }, }, }) /* eslint-disable @typescript-eslint/no-unused-vars */
  • How To Start Testing React Apps (And Why I Recommend Cypress To Beginners)
    2 projects | dev.to | 23 Sep 2022
    Note that the last test is a bit more complex. Cypress doesn’t have a native way to test if an element is outside the viewport. I found this GitHub issue to be helpful.
  • Cypress vs Playwright – Clash of the Titans: Introduction (1)
    3 projects | dev.to | 20 Sep 2022
    GitHub issues: https://github.com/cypress-io/cypress/issues
  • Testing Copy to Clipboard with Cypress
    2 projects | dev.to | 9 Sep 2022
    How to test these scenario with Cypress?
  • How to set up a local E2E test development environment
    3 projects | dev.to | 5 Sep 2022
    For this tutorial, we're going to use Cypress, which in my opinion currently is the best end-to-end testing solution. (My one gripe with Cypress is the lack of support for testing of older browsers, which are the ones often causing regressions.)
  • Cypress 10.7 changelog
    2 projects | reddit.com/r/Cypress | 30 Aug 2022
    Re-introduces the experimental Cypress Studio feature. Cypress Studio provides a visual way to generate tests within Cypress by recording interactions against the application under test. Cypress Studio is available only in end-to-end tests, and must be enabled via the e2e.experimentalStudio flag. For more details, read our blog post. Addresses #23461.
  • Introducing Angular Component Testing
    2 projects | dev.to | 16 Aug 2022
    For a complete list of updates in 10.5.0, please review our changelog. If this feature is helpful, or if you have other ideas or feedback, let us know on Github.
  • Ask HN: How to price a service that saves hundreds of engineering hours?
    3 projects | news.ycombinator.com | 13 Aug 2022
    I have the opposite experience. LocalStorage can leak between tests and that has been an issue for years: https://github.com/cypress-io/cypress/issues/2695

What are some alternatives?

When comparing jest and Cypress you can also consider the following projects:

tap - Test Anything Protocol tools for node

Playwright - Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

vitest - A Vite-native test framework. It's fast!

Detox - Gray box end-to-end testing and automation framework for mobile apps

Cucumber.js - Cucumber for JavaScript

Sinon.JS - Test spies, stubs and mocks for JavaScript.

nyc - the Istanbul command line interface

WebdriverIO - Next-gen browser and mobile automation test framework for Node.js

ava - Node.js test runner that lets you develop with confidence 🚀

nightwatch - End-to-end testing framework written in Node.js and using the W3C Webdriver API

istanbul - Yet another JS code coverage tool that computes statement, line, function and branch coverage with module loader hooks to transparently add coverage when running tests. Supports all JS coverage use cases including unit tests, server side functional tests and browser tests. Built for scale.

mocha - ☕️ simple, flexible, fun javascript test framework for node.js & the browser