What Are the Differences Between Jasmine, Mocha and Cucumber Testing Framework

Author: Timothy Joseph
Timothy Joseph | January 11, 2021

What Are the Differences Between Jasmine, Mocha and Cucumber Testing Framework

Cucumber JS, Jasmine, and Mocha are the most commonly used frameworks used in JavaScript. Below is the comparison of all these frameworks w.r.t features:

Feature Cucumber JS Jasmine Mocha
Assertion library
Need to be integrated with Cucumber-assert
Inbuilt
Need to be integrated with different assertion libraries: Chai, should.js, expect.js, better-assert
Gerkin Language support
Inbuilt
Need to be integrated with Karma or Cucumber
Need to be integrated with Mocha-Cakes or mocha-gerkin
Grouping/tagging of test
Yes
Yes
Yes
Test Runner
Command line
Command line
Command line
Reporting
Intuitive reports using cucumber-html-reporter and multiple-cucumber-html-reporter libraries
Either cucumber reports can be generated or karma-jasmine-html-reporter or jasmine-pretty-html-reporter can be used, but these reports are less intuitive than Cucumber
Mocha-simple-html-reporter and mochawesome can be used for reporting. Mochawesome reports are intuitive, just like cucumber reports
Documentation/Forums support
Yes
Yes
Yes
Rerun of failed tests
No inbuilt support for JS version of Cucumber
No inbuilt support
Inbuilt support available
Highlight slow tests
No support available
Can be implemented using jasmine-slow-reporter
Inbuilt support available
Asynchronous testing
Easy
Difficult
Easy
Parallel execution
Yes
Yes
Yes
Plug-in support and extensibility
Limited
Limited
Good

All the above are used for JavaScript based frameworks.

Disclaimer

This publication is for informational purposes only, and nothing contained in it should be considered legal advice. We expressly disclaim any warranty or responsibility for damages arising out of this information and encourage you to consult with legal counsel regarding your specific needs. We do not undertake any duty to update previously posted materials.

Post a Comment