Jasmine
Jasmine

659
260
167
Mocha
Mocha

2.1K
388
399
Add tool

Jasmine vs Mocha: What are the differences?

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.

What is Mocha? Simple, flexible, fun javascript test framework for node.js & the browser. 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.

Jasmine and Mocha belong to "Javascript Testing Framework" category of the tech stack.

"Can also be used for tdd " is the primary reason why developers consider Jasmine over the competitors, whereas "Open source" was stated as the key factor in picking Mocha.

Jasmine and Mocha are both open source tools. Mocha with 18K GitHub stars and 2.43K forks on GitHub appears to be more popular than Jasmine with 14.4K GitHub stars and 2.12K GitHub forks.

Sellsuki, Onedio, and triGo GmbH are some of the popular companies that use Mocha, whereas Jasmine is used by Coderus, Infoshare, and Ztory. Mocha has a broader approval, being mentioned in 397 company stacks & 268 developers stacks; compared to Jasmine, which is listed in 143 company stacks and 75 developer stacks.

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.

What is 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.

Want advice about which of these to choose?Ask the StackShare community!

Why do developers choose Jasmine?
Why do developers choose Mocha?
What are the cons of using Jasmine?
What are the cons of using Mocha?
    Be the first to leave a con
    What companies use Jasmine?
    What companies use Mocha?
    What are some alternatives to Jasmine and Mocha?
    Jest
    Jest provides you with multiple layers on top of Jasmine.
    Karma
    Karma is not a testing framework, nor an assertion library. Karma just launches a HTTP server, and generates the test runner HTML file you probably already know from your favourite testing framework. So for testing purposes you can use pretty much anything you like.
    Enzyme
    Enzyme is a JavaScript Testing utility for React that makes it easier to assert, manipulate, and traverse your React Components' output.
    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
    What tools integrate with Jasmine?
    What tools integrate with Mocha?
      No integrations found
        No integrations found
        Decisions about Jasmine and Mocha
        No stack decisions found
        Interest over time
        Reviews of Jasmine and Mocha
        No reviews found
        How developers use Jasmine and Mocha
        Avatar of Matt Welke
        Matt Welke uses MochaMocha

        Used for unit testing when working with Node.js. Used over other testing frameworks because of good compatibility with TypeScript and ts-node.

        Avatar of Kang Hyeon Ku
        Kang Hyeon Ku uses MochaMocha

        javascript 테스트를 위해 써본 프레임워크 이다. 초반 유명한 프레임워크중 하나였는데 요즘은 너무 테스트 프레임워크도 다양해져 잘 모르겠다. junit 에게는 hamcrest 이 있다면 mocha 에게는 chai가 있다.

        Avatar of Dave Woolfenden
        Dave Woolfenden uses MochaMocha

        Is a feature-rich JavaScript test framework running on Node.js and in the browser supporting asynchronous testing.

        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 Kingsley Victor
        Kingsley Victor uses MochaMocha

        Mocha is ideal for running tests on apis built with Node's Express

        Avatar of Tim De Lange
        Tim De Lange uses MochaMocha

        Unit testing on shared code between brow ser and back end.

        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 Evan Luc
        Evan Luc uses JasmineJasmine

        Front and back-end tests.

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