StackShareStackShare
Follow on
StackShare

Discover and share technology stacks from companies around the world.

Product

  • Stacks
  • Tools
  • Companies
  • Feed

Company

  • About
  • Blog
  • Contact

Legal

  • Privacy Policy
  • Terms of Service

© 2025 StackShare. All rights reserved.

API StatusChangelog
Jest
ByJestJest

Jest

#2in Testing Frameworks
Stacks10kDiscussions131
Followers4.1k
OverviewDiscussions131

What is Jest?

Jest provides you with multiple layers on top of Jasmine.

Jest is a tool in the Testing Frameworks category of a tech stack.

Key Features

Familiar Approach: Built on top of the Jasmine test framework, using familiar expect(value).toBe(other) assertionsMock by Default: Automatically mocks CommonJS modules returned by require(), making most existing code testableShort Feedback Loop: DOM APIs are mocked and tests run in parallel via a small node.js command line utility

Jest Pros & Cons

Pros of Jest

  • ✓Open source
  • ✓Mock by default makes testing much simpler
  • ✓Testing React Native Apps
  • ✓Parallel test running
  • ✓Fast
  • ✓Bundled with JSDOM to enable DOM testing
  • ✓Mock by default screws up your classes, breaking tests
  • ✓Out of the box code coverage
  • ✓Promise support
  • ✓One stop shop for unit testing

Cons of Jest

  • ✗Ambiguous configuration
  • ✗Documentation
  • ✗Difficult
  • ✗Ambiguous
  • ✗Bugged
  • ✗Difficult to run single test/describe/file
  • ✗Many bugs still not fixed months/years after reporting
  • ✗Multiple error messages for same error
  • ✗Bad docs
  • ✗BeforeAll timing out makes all passing tests fail

Jest Alternatives & Comparisons

What are some alternatives to Jest?

Mocha

Mocha

Mocha is a feature-rich JavaScript test framework running on node.js and the browser, making asynchronous testing simple and fun. Mocha tests run serially, allowing for flexible and accurate reporting, while mapping uncaught exceptions to the correct test cases.

Chai

Chai

It is a BDD / TDD assertion library for node and the browser that can be delightfully paired with any javascript testing framework. It has several interfaces that allow the developer to choose the most comfortable. The chain-capable BDD styles provide an expressive language & readable style, while the TDD assert style provides a more classical feel.

Jasmine

Jasmine

Jasmine is a Behavior Driven Development testing framework for JavaScript. It does not rely on browsers, DOM, or any JavaScript framework. Thus it's suited for websites, Node.js projects, or anywhere that JavaScript can run.

Cypress

Cypress

Cypress is a front end automated testing application created for the modern web. Cypress is built on a new architecture and runs in the same run-loop as the application being tested. As a result Cypress provides better, faster, and more reliable testing for anything that runs in a browser. Cypress works on any front-end framework or website.

SinonJS

SinonJS

It is a really helpful library when you want to unit test your code. It supports spies, stubs, and mocks. The library has cross browser support and also can run on the server using Node.js.

Protractor

Protractor

Protractor is an end-to-end test framework for Angular and AngularJS applications. Protractor runs tests against your application running in a real browser, interacting with it as a user would.

Jest Integrations

Glamorous, Majestic GUI, MockIt (open source), Just, SilverStripe and 7 more are some of the popular tools that integrate with Jest. Here's a list of all 12 tools that integrate with Jest.

Glamorous
Glamorous
Majestic GUI
Majestic GUI
MockIt (open source)
MockIt (open source)
Just
Just
SilverStripe
SilverStripe
Wallaby.js
Wallaby.js
Knapsack Pro
Knapsack Pro
Zaplib
Zaplib
LambdaTest
LambdaTest
Vitest
Vitest
Testomat
Testomat
Foresight
Foresight

Jest Discussions

Discover why developers choose Jest. Read real-world technical decisions and stack choices from the StackShare community.

Russel Werner
Russel Werner

Lead Engineer at StackShare

Mar 11, 2019

Needs adviceonJestJestEnzymeEnzymeReact StorybookReact Storybook

We use Jest because when we rebooted our "front end" stack earlier last year, we need to have a testing solution (we didn't have any front-end tests before that!). Jest is fast and convenient and it has plenty of community support behind it. It let's us run our unit tests with Enzyme and snapshot tests.

This is an area that we are constantly reviewing to see what can be improved, both in terms of developer needs, accuracy, test maintainability, and coverage.

I'm currently exploring using React Storybook to be the record of snapshot tests and using some online services, such as Happo.io and Percy in our CI pipeline.

0 views0
Comments
David Johnston
David Johnston

Jan 21, 2019

Needs adviceonredux-sagaredux-sagaReduxReduxReactReact

Choosing redux-saga for my async Redux middleware, for a React application, instead of the typical redux-thunk .

Redux-saga is much easier to test than Redux-thunk - it requires no module mocking at all. Converting from redux-thunk to redux-saga is easy enough, as you are only refactoring the action creators - not your redux store or your react components. I've linked a github repo that shows the same solution with both, including Jest tests.

0 views0
Comments
Lars Lockefeer
Lars Lockefeer

Mobile Tech Lead at Picnic Technologies

Dec 3, 2018

Needs adviceonReact NativeReact NativeTypeScriptTypeScriptReduxRedux

Earlier this year, we started developing a new app to help our runners deliver groceries to our customers. We chose React Native over a native app or a PWA and are really happy with it. So far, we really like what we are seeing. Development speed is fast and the tooling is awesome. The “learn once, write anywhere”-promise is really fulfilled and when we ran our project for the first time on iOS after a few weeks of development, we were excited to see how well it worked and what it looked like.

Read our blog post to learn more about how we use React Native, TypeScript, Redux, RxJS, CodePush, styled-components, React Storybook, Jest, and Prettier to develop this app, as well as our thought of what else we will do with it at Picnic.

0 views0
Comments
Dschinkel Schinkel
Dschinkel Schinkel

Nov 30, 2018

Needs adviceonMochaMochaJestJestJavaScriptJavaScript

I use both mocha and Jest because:

  • I don't care whether teams use Jest or Mocha. But jest is way too overhyped. Most devs are writing integration tests and think that it's so much better but frankly I don't write integration tests as the way to get both design feedback and confidence when I code. I adhere to the test pyramid, not ice cream cone or the dumb "trophy"

  • I TDD, so I only ever use the "API" of test frameworks. I don't do a lot of integration tests for TDD and all the bells and whistles Jest provides you from the command-line I just don't need. And I certainly do not care about or touch Jest Snapshots, I despise them

  • My tests are fast enough because I write isolated tests with TDD, so I don't run into performance issues. Example: I write my tests in a way that I can run 300 tests in literally 1 second with mocha. So the Jest ability to pinpoint and only run those tests which are affected by code changes. I want to run all of them every time when I TDD. It's a different mindset when you TDD

  • I also mainly code in IntelliJ or WebStorm because I feel the tools in that IDE far surpass VSCode and I also love running the test UI runner in it vs. lousy command-line

  • I feel both mocha and Jest read just fine in terms of code readability. Jest might have shorter assertion syntax but I don't really care. I just care that I can read the damn test and my tests are written well and my test descriptions, as well as the code itself including constants represent business language, not technical. I care most about BDD, clean code, 4 rules of simple design, and SOLID

  • I don't like using mock frameworks so no I don't use Jest's Mocking framework. I don't have to mock a lot in my tests due to the nature of how I strive to code...I keep my design simple and modular using principals such as clean code and 4 rules of simple design. If I must mock, I create very simple custom mocks with JS

  • On the contrary to the belief that integration tests and mount are the way to go (this belief drives me absolutely crazy, especially Dodd's promoting that), I TDD with shallow & enzyme. My tests are simple. My design is driven by my tests and my tests give me quick and useful feedback. I have a course I'm working on coming out soon on TDD with React to show you how to truly test the FE and why the ice cream cone and trophy suck (you're being scammed people). Watch for that here: https://twitter.com/DaveSchinkel/status/1062267649235791873

Don't forget to upvote this post!

Mocha Jest JavaScript React @jsdom Enzyme ##tdd ##bdd ##testdrivendevelopment

0 views0
Comments
Eli Hooten
Eli Hooten

CTO at Codecov

Nov 30, 2018

Needs adviceonVue.jsVue.jsPythonPythonvuexvuex

We chose Vue.js at Codecov to replace a front end that was based mostly on server side rendered Python templates, and was getting fairly long in the tooth. The move to Vue.js allowed us to take a more component driven approach to our front end, providing greater flexibility and reuse when creating new pages and refactoring old ones. Another bonus was how easily we could integrate Axios with VueJS for making AJAX calls within Vue.js components and their associated vuex stores. We were also able to easily integrate Vue.js with the Jest testing framework, which allowed to provide test coverage for a front end where none previously existed.

The move to Vue.js has allowed us to be more agile in our front end development by further decoupling our front end from our back end. Additionally, by fully embracing a component-driven approach, we're able to more easily isolate and test functionality, leading to a more readible, maintainable, and extensible front end codebase.

0 views0
Comments

Try It

Visit Website

Adoption

On StackShare

Companies
1.27k
AACEFF+1260
Developers
4.36k
YTLCDG+4358