Get Advice Icon

Need advice about which tool to choose?Ask the StackShare community!

Enzyme
Enzyme

243
165
+ 1
0
Jasmine
Jasmine

697
511
+ 1
168
Add tool

Enzyme vs Jasmine: What are the differences?

What is Enzyme? JavaScript Testing utilities for React, by Airbnb. Enzyme is a JavaScript Testing utility for React that makes it easier to assert, manipulate, and traverse your React Components' output.

What is Jasmine? DOM-less simple JavaScript testing framework. 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.

Enzyme and Jasmine can be primarily classified as "Javascript Testing Framework" tools.

Enzyme and Jasmine are both open source tools. It seems that Enzyme with 17.4K GitHub stars and 1.91K forks on GitHub has more adoption than Jasmine with 14.4K GitHub stars and 2.12K GitHub forks.

According to the StackShare community, Jasmine has a broader approval, being mentioned in 143 company stacks & 75 developers stacks; compared to Enzyme, which is listed in 51 company stacks and 32 developer stacks.

What is Enzyme?

Enzyme is a JavaScript Testing utility for React that makes it easier to assert, manipulate, and traverse your React Components' output.

What is 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.
Get Advice Icon

Need advice about which tool to choose?Ask the StackShare community!

Why do developers choose Enzyme?
Why do developers choose Jasmine?
    Be the first to leave a pro

    Sign up to add, upvote and see more prosMake informed product decisions

      Be the first to leave a con
      What companies use Enzyme?
      What companies use Jasmine?

      Sign up to get full access to all the companiesMake informed product decisions

      What tools integrate with Enzyme?
      What tools integrate with Jasmine?
      What are some alternatives to Enzyme and Jasmine?
      react-testing-library
      It is a simple and complete React DOM testing utility that encourage good testing practices. It provides light utility functions on top of react-dom and react-dom/test-utils, in a way that encourages better testing practices.
      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.
      Jest
      Jest provides you with multiple layers on top of Jasmine.
      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.
      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.
      See all alternatives
      Decisions about Enzyme and Jasmine
      Dschinkel Schinkel
      Dschinkel Schinkel
      Enzyme
      Enzyme
      React
      React
      JavaScript
      JavaScript
      Jest
      Jest
      Mocha
      Mocha
      #Testdrivendevelopment
      #Bdd
      #Tdd

      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

      See more
      Russel Werner
      Russel Werner
      Lead Engineer at StackShare | 7 upvotes 44.6K views
      atStackShareStackShare
      Percy
      Percy
      Happo.io
      Happo.io
      React Storybook
      React Storybook
      Enzyme
      Enzyme
      Jest
      Jest

      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.

      See more
      Gustavo Mu帽oz
      Gustavo Mu帽oz
      Web UI Developer at Globant | 1 upvotes 1.3K views
      Enzyme
      Enzyme
      Jest
      Jest

      I really enjoy using Jest as my testing framework. I also use Enzyme to complement, and both together are amazing. Jest is fast and easy to use, It has all you need together under the same tool, and it's pretty easy to create all kind of test, even asynchronous ones. I was responsible for implant it in our company projects, and it was the best decision for testing.

      See more
      Jorge Quiros
      Jorge Quiros
      SR QA Automation Engineer at Indecomm | 8 upvotes 205.9K views
      Cypress
      Cypress
      Selenium
      Selenium
      JavaScript
      JavaScript
      Jasmine
      Jasmine
      Protractor
      Protractor
      #Qaautomation
      #Cypress
      #Testing

      This is a trending topic on Automation testing for E2E web applications.

      I have used Protractor and Jasmine for automation testing frameworks in JavaScript by using the Selenium web driver manager.

      Now, new guy in town Cypress does not use Selenium and runs directly in your app without any json wire protrocol, but it does not support parallel testing or mobile testing.

      Have you experienced both? Should I stick with old and known ?

      #testing cypress #selenium qaautomation #qa

      See more
      Interest over time
      Reviews of Enzyme and Jasmine
      No reviews found
      How developers use Enzyme and Jasmine
      Avatar of RentChek
      RentChek uses JasmineJasmine

      We use Jasmine for all our front-end web interface tests. Works great for testing all our Angular components.

      Avatar of Ron Apelbaum
      Ron Apelbaum uses JasmineJasmine

      I write unit tests with Jasmine, and use nodejs Jasmine as a test runner.

      Avatar of Thibault Maekelbergh
      Thibault Maekelbergh uses EnzymeEnzyme

      Component and DOM testing for React integrated with Mocha.

      Avatar of toby lin
      toby lin uses EnzymeEnzyme

      learn it in react-boilerplate. so much to learn

      Avatar of Fred Steffen
      Fred Steffen uses JasmineJasmine

      It has tons of features, great documentation

      Avatar of Giovanni Candido da Silva
      Giovanni Candido da Silva uses JasmineJasmine

      Test tool for the interface code

      Avatar of Dave Woolfenden
      Dave Woolfenden uses EnzymeEnzyme

      Designed to work with Mocha

      Avatar of Evan Luc
      Evan Luc uses JasmineJasmine

      Front and back-end tests.

      How much does Enzyme cost?
      How much does Jasmine cost?
      Pricing unavailable
      Pricing unavailable
      News about Enzyme
      More news
      News about Jasmine
      More news