Alternatives to Jest logo

Alternatives to Jest

Mocha, Selenium, AVA, Enzyme, and Jasmine are the most popular alternatives and competitors to Jest.
9.3K
3.8K
+ 1
175

What is Jest and what are its top alternatives?

Jest provides you with multiple layers on top of Jasmine.
Jest is a tool in the Javascript Testing Framework category of a tech stack.
Jest is an open source tool with GitHub stars and GitHub forks. Here’s a link to Jest's open source repository on GitHub

Top 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. ...

  • Selenium
    Selenium

    Selenium automates browsers. That's it! What you do with that power is entirely up to you. Primarily, it is for automating web applications for testing purposes, but is certainly not limited to just that. Boring web-based administration tasks can (and should!) also be automated as well. ...

  • AVA
    AVA

    Even though JavaScript is single-threaded, IO in Node.js can happen in parallel due to its async nature. AVA takes advantage of this and runs your tests concurrently, which is especially beneficial for IO heavy tests. In addition, test files are run in parallel as separate processes, giving you even better performance and an isolated environment for each test file. ...

  • Enzyme
    Enzyme

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

  • 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. ...

  • 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. ...

  • JavaScript
    JavaScript

    JavaScript is most known as the scripting language for Web pages, but used in many non-browser environments as well such as node.js or Apache CouchDB. It is a prototype-based, multi-paradigm scripting language that is dynamic,and supports object-oriented, imperative, and functional programming styles. ...

Jest alternatives & related posts

Mocha logo

Mocha

8.5K
2.9K
430
Simple, flexible, fun javascript test framework for node.js & the browser
8.5K
2.9K
+ 1
430
PROS OF MOCHA
  • 137
    Open source
  • 102
    Simple
  • 81
    Promise support
  • 48
    Flexible
  • 29
    Easy to add support for Generators
  • 12
    For browser and server testing
  • 7
    Curstom assertion libraries
  • 5
    Works with Karma
  • 3
    No other better tools
  • 1
    Simple setup
  • 1
    Works with saucelabs
  • 1
    Lots of tutorials and help online
  • 1
    Default reporter is nice, clean, and itemized
  • 1
    Works with BrowserStack
  • 1
    Simple integration testing
CONS OF MOCHA
  • 3
    Cannot test a promisified functions without assertion
  • 2
    No assertion count in results
  • 1
    Not as many reporter options as Jest

related Mocha posts

Anurag Maurya

Needs advice on code coverage tool in Node.js/ExpressJS with External API Testing Framework

Hello community,

I have a web application with the backend developed using Node.js and Express.js. The backend server is in one directory, and I have a separate API testing framework, made using SuperTest, Mocha, and Chai, in another directory. The testing framework pings the API, retrieves responses, and performs validations.

I'm currently looking for a code coverage tool that can accurately measure the code coverage of my backend code when triggered by the API testing framework. I've tried using Istanbul and NYC with instrumented code, but the results are not as expected.

Could you please recommend a reliable code coverage tool or suggest an approach to effectively measure the code coverage of my Node.js/Express.js backend code in this setup?

See more

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
Selenium logo

Selenium

15.4K
12.3K
525
Web Browser Automation
15.4K
12.3K
+ 1
525
PROS OF SELENIUM
  • 175
    Automates browsers
  • 154
    Testing
  • 101
    Essential tool for running test automation
  • 24
    Record-Playback
  • 24
    Remote Control
  • 8
    Data crawling
  • 7
    Supports end to end testing
  • 6
    Easy set up
  • 6
    Functional testing
  • 4
    The Most flexible monitoring system
  • 3
    End to End Testing
  • 3
    Easy to integrate with build tools
  • 2
    Comparing the performance selenium is faster than jasm
  • 2
    Record and playback
  • 2
    Compatible with Python
  • 2
    Easy to scale
  • 2
    Integration Tests
  • 0
    Integrated into Selenium-Jupiter framework
CONS OF SELENIUM
  • 8
    Flaky tests
  • 4
    Slow as needs to make browser (even with no gui)
  • 2
    Update browser drivers

related Selenium posts

Kamil Kowalski
Lead Architect at Fresha · | 28 upvotes · 3.9M views

When you think about test automation, it’s crucial to make it everyone’s responsibility (not just QA Engineers'). We started with Selenium and Java, but with our platform revolving around Ruby, Elixir and JavaScript, QA Engineers were left alone to automate tests. Cypress was the answer, as we could switch to JS and simply involve more people from day one. There's a downside too, as it meant testing on Chrome only, but that was "good enough" for us + if really needed we can always cover some specific cases in a different way.

See more
Benjamin Poon
QA Manager - Engineering at HBC Digital · | 8 upvotes · 1.9M views

For our digital QA organization to support a complex hybrid monolith/microservice architecture, our team took on the lofty goal of building out a commonized UI test automation framework. One of the primary requisites included a technical minimalist threshold such that an engineer or analyst with fundamental knowledge of JavaScript could automate their tests with greater ease. Just to list a few: - Nightwatchjs - Selenium - Cucumber - GitHub - Go.CD - Docker - ExpressJS - React - PostgreSQL

With this structure, we're able to combine the automation efforts of each team member into a centralized repository while also providing new relevant metrics to business owners.

See more
AVA logo

AVA

110
204
32
A refined, futuristic test runner
110
204
+ 1
32
PROS OF AVA
  • 12
    Simple and fast
  • 6
    Parallel test running
  • 5
    Open source
  • 3
    Promise support
  • 3
    Test code Instrumenting
  • 2
    Babel integration
  • 1
    ESM Ready
CONS OF AVA
  • 1
    No built-in support for DOM
  • 1
    No source files compilation

related AVA posts

Recently I have been working on an open source stack to help people consolidate their personal health data in a single database so that AI and analytics apps can be run against it to find personalized treatments. We chose to go with a #containerized approach leveraging Docker #containers with a local development environment setup with Docker Compose and nginx for container routing. For the production environment we chose to pull code from GitHub and build/push images using Jenkins and using Kubernetes to deploy to Amazon EC2.

We also implemented a dashboard app to handle user authentication/authorization, as well as a custom SSO server that runs on Heroku which allows experts to easily visit more than one instance without having to login repeatedly. The #Backend was implemented using my favorite #Stack which consists of FeathersJS on top of Node.js and ExpressJS with PostgreSQL as the main database. The #Frontend was implemented using React, Redux.js, Semantic UI React and the FeathersJS client. Though testing was light on this project, we chose to use AVA as well as ESLint to keep the codebase clean and consistent.

See more
Enzyme logo

Enzyme

962
347
0
JavaScript Testing utilities for React, by Airbnb
962
347
+ 1
0
PROS OF ENZYME
    Be the first to leave a pro
    CONS OF ENZYME
      Be the first to leave a con

      related Enzyme posts

      Russel Werner
      Lead Engineer at StackShare · | 7 upvotes · 178.5K views

      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

      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
      Jasmine logo

      Jasmine

      2.6K
      1.5K
      186
      DOM-less simple JavaScript testing framework
      2.6K
      1.5K
      + 1
      186
      PROS OF JASMINE
      • 64
        Can also be used for tdd
      • 49
        Open source
      • 18
        Originally from RSpec
      • 15
        Great community
      • 14
        No dependencies, not even DOM
      • 10
        Easy to setup
      • 8
        Simple
      • 3
        Created by Pivotal-Labs
      • 2
        Works with KarmaJs
      • 1
        Jasmine is faster than selenium in angular application
      • 1
        SpyOn to fake calls
      • 1
        Async and promises are easy calls with "done"
      CONS OF JASMINE
      • 2
        Unfriendly error logs

      related Jasmine posts

      Joshua Dean Küpper
      CEO at Scrayos UG (haftungsbeschränkt) · | 7 upvotes · 606.5K views

      For our internal team and collaboration panel we use Nuxt.js (with TypeScript that is transpiled into ES6), Webpack and npm. We enjoy the opinionated nature of Nuxt.js over vanilla Vue.js, as we would end up using all of the components Nuxt.js incorporates anyways and we can adhere to the conventions setup by the Nuxt.js project, which allows us to get better support in case we run into any dead ends. Webpack allows us to create reproducable builds and also debug our application with hot reloads, which greately increased the pace at which we are able to perform and test changes. We also incorporated a lot of testing (ESLint, Chai, Jasmine, Nightwatchjs) into our pipelines and can trigger those jobs through GitLab CI. All packages are fetched through npm, so that we can keep our git repositories slim and are notified of new updates aswell as reported security flaws.

      See more
      Sai Chaitanya Mankala
      Tech Lead at KIOT Innovations · | 6 upvotes · 863K views

      Protractor or Cypress for ionic-angular?

      We have a huge ionic-angular app with almost 100 pages and 10+ injectables. There are no tests written yet. Before we start, we need some suggestions about the framework. Would you suggest Cypress or Angular's Protractor with Jasmine / Karma for a heavy ionic app with Angular?

      See more
      Cypress logo

      Cypress

      2.3K
      2K
      114
      When testing is easy, developers build better things faster and with confidence.
      2.3K
      2K
      + 1
      114
      PROS OF CYPRESS
      • 29
        Open source
      • 22
        Great documentation
      • 20
        Simple usage
      • 18
        Fast
      • 10
        Cross Browser testing
      • 9
        Easy us with CI
      • 5
        Npm install cypress only
      • 1
        Good for beginner automation engineers
      CONS OF CYPRESS
      • 21
        Cypress is weak at cross-browser testing
      • 14
        Switch tabs : Cypress can'nt support
      • 12
        No iFrame support
      • 9
        No page object support
      • 9
        No multiple domain support
      • 8
        No file upload support
      • 8
        No support for multiple tab control
      • 8
        No xPath support
      • 7
        No support for Safari
      • 7
        Cypress doesn't support native app
      • 7
        Re-run failed tests retries not supported yet
      • 7
        No support for multiple browser control
      • 5
        $20/user/thread for reports
      • 4
        Adobe
      • 4
        Using a non-standard automation protocol
      • 4
        Not freeware
      • 3
        No 'WD wire protocol' support

      related Cypress posts

      Kamil Kowalski
      Lead Architect at Fresha · | 28 upvotes · 3.9M views

      When you think about test automation, it’s crucial to make it everyone’s responsibility (not just QA Engineers'). We started with Selenium and Java, but with our platform revolving around Ruby, Elixir and JavaScript, QA Engineers were left alone to automate tests. Cypress was the answer, as we could switch to JS and simply involve more people from day one. There's a downside too, as it meant testing on Chrome only, but that was "good enough" for us + if really needed we can always cover some specific cases in a different way.

      See more
      Robert Zuber

      We are in the process of adopting Next.js as our React framework and using Storybook to help build our React components in isolation. This new part of our frontend is written in TypeScript, and we use Emotion for CSS/styling. For delivering data, we use GraphQL and Apollo. Jest, Percy, and Cypress are used for testing.

      See more
      Chai logo

      Chai

      3.8K
      195
      0
      A BDD / TDD assertion library
      3.8K
      195
      + 1
      0
      PROS OF CHAI
        Be the first to leave a pro
        CONS OF CHAI
          Be the first to leave a con

          related Chai posts

          Anurag Maurya

          Needs advice on code coverage tool in Node.js/ExpressJS with External API Testing Framework

          Hello community,

          I have a web application with the backend developed using Node.js and Express.js. The backend server is in one directory, and I have a separate API testing framework, made using SuperTest, Mocha, and Chai, in another directory. The testing framework pings the API, retrieves responses, and performs validations.

          I'm currently looking for a code coverage tool that can accurately measure the code coverage of my backend code when triggered by the API testing framework. I've tried using Istanbul and NYC with instrumented code, but the results are not as expected.

          Could you please recommend a reliable code coverage tool or suggest an approach to effectively measure the code coverage of my Node.js/Express.js backend code in this setup?

          See more
          Joshua Dean Küpper
          CEO at Scrayos UG (haftungsbeschränkt) · | 7 upvotes · 606.5K views

          For our internal team and collaboration panel we use Nuxt.js (with TypeScript that is transpiled into ES6), Webpack and npm. We enjoy the opinionated nature of Nuxt.js over vanilla Vue.js, as we would end up using all of the components Nuxt.js incorporates anyways and we can adhere to the conventions setup by the Nuxt.js project, which allows us to get better support in case we run into any dead ends. Webpack allows us to create reproducable builds and also debug our application with hot reloads, which greately increased the pace at which we are able to perform and test changes. We also incorporated a lot of testing (ESLint, Chai, Jasmine, Nightwatchjs) into our pipelines and can trigger those jobs through GitLab CI. All packages are fetched through npm, so that we can keep our git repositories slim and are notified of new updates aswell as reported security flaws.

          See more
          JavaScript logo

          JavaScript

          350.4K
          266.8K
          8.1K
          Lightweight, interpreted, object-oriented language with first-class functions
          350.4K
          266.8K
          + 1
          8.1K
          PROS OF JAVASCRIPT
          • 1.7K
            Can be used on frontend/backend
          • 1.5K
            It's everywhere
          • 1.2K
            Lots of great frameworks
          • 896
            Fast
          • 745
            Light weight
          • 425
            Flexible
          • 392
            You can't get a device today that doesn't run js
          • 286
            Non-blocking i/o
          • 236
            Ubiquitousness
          • 191
            Expressive
          • 55
            Extended functionality to web pages
          • 49
            Relatively easy language
          • 46
            Executed on the client side
          • 30
            Relatively fast to the end user
          • 25
            Pure Javascript
          • 21
            Functional programming
          • 15
            Async
          • 13
            Full-stack
          • 12
            Setup is easy
          • 12
            Its everywhere
          • 11
            JavaScript is the New PHP
          • 11
            Because I love functions
          • 10
            Like it or not, JS is part of the web standard
          • 9
            Can be used in backend, frontend and DB
          • 9
            Expansive community
          • 9
            Future Language of The Web
          • 9
            Easy
          • 8
            No need to use PHP
          • 8
            For the good parts
          • 8
            Can be used both as frontend and backend as well
          • 8
            Everyone use it
          • 8
            Most Popular Language in the World
          • 8
            Easy to hire developers
          • 7
            Love-hate relationship
          • 7
            Powerful
          • 7
            Photoshop has 3 JS runtimes built in
          • 7
            Evolution of C
          • 7
            Popularized Class-Less Architecture & Lambdas
          • 7
            Agile, packages simple to use
          • 7
            Supports lambdas and closures
          • 6
            1.6K Can be used on frontend/backend
          • 6
            It's fun
          • 6
            Hard not to use
          • 6
            Nice
          • 6
            Client side JS uses the visitors CPU to save Server Res
          • 6
            Versitile
          • 6
            It let's me use Babel & Typescript
          • 6
            Easy to make something
          • 6
            Its fun and fast
          • 6
            Can be used on frontend/backend/Mobile/create PRO Ui
          • 5
            Function expressions are useful for callbacks
          • 5
            What to add
          • 5
            Client processing
          • 5
            Everywhere
          • 5
            Scope manipulation
          • 5
            Stockholm Syndrome
          • 5
            Promise relationship
          • 5
            Clojurescript
          • 4
            Because it is so simple and lightweight
          • 4
            Only Programming language on browser
          • 1
            Hard to learn
          • 1
            Test
          • 1
            Test2
          • 1
            Easy to understand
          • 1
            Not the best
          • 1
            Easy to learn
          • 1
            Subskill #4
          • 0
            Hard 彤
          CONS OF JAVASCRIPT
          • 22
            A constant moving target, too much churn
          • 20
            Horribly inconsistent
          • 15
            Javascript is the New PHP
          • 9
            No ability to monitor memory utilitization
          • 8
            Shows Zero output in case of ANY error
          • 7
            Thinks strange results are better than errors
          • 6
            Can be ugly
          • 3
            No GitHub
          • 2
            Slow

          related JavaScript posts

          Zach Holman

          Oof. I have truly hated JavaScript for a long time. Like, for over twenty years now. Like, since the Clinton administration. It's always been a nightmare to deal with all of the aspects of that silly language.

          But wowza, things have changed. Tooling is just way, way better. I'm primarily web-oriented, and using React and Apollo together the past few years really opened my eyes to building rich apps. And I deeply apologize for using the phrase rich apps; I don't think I've ever said such Enterprisey words before.

          But yeah, things are different now. I still love Rails, and still use it for a lot of apps I build. But it's that silly rich apps phrase that's the problem. Users have way more comprehensive expectations than they did even five years ago, and the JS community does a good job at building tools and tech that tackle the problems of making heavy, complicated UI and frontend work.

          Obviously there's a lot of things happening here, so just saying "JavaScript isn't terrible" might encompass a huge amount of libraries and frameworks. But if you're like me, yeah, give things another shot- I'm somehow not hating on JavaScript anymore and... gulp... I kinda love it.

          See more
          Conor Myhrvold
          Tech Brand Mgr, Office of CTO at Uber · | 44 upvotes · 9.7M views

          How Uber developed the open source, end-to-end distributed tracing Jaeger , now a CNCF project:

          Distributed tracing is quickly becoming a must-have component in the tools that organizations use to monitor their complex, microservice-based architectures. At Uber, our open source distributed tracing system Jaeger saw large-scale internal adoption throughout 2016, integrated into hundreds of microservices and now recording thousands of traces every second.

          Here is the story of how we got here, from investigating off-the-shelf solutions like Zipkin, to why we switched from pull to push architecture, and how distributed tracing will continue to evolve:

          https://eng.uber.com/distributed-tracing/

          (GitHub Pages : https://www.jaegertracing.io/, GitHub: https://github.com/jaegertracing/jaeger)

          Bindings/Operator: Python Java Node.js Go C++ Kubernetes JavaScript OpenShift C# Apache Spark

          See more