Introducing
The Slant team built an AI & it’s awesome
Find the best product instantly
Add to Chrome
Add to Edge
Add to Firefox
Add to Opera
Add to Brave
Add to Safari
Try it now
4.7 star rating
0
Development
What are the best Node.js test frameworks?
3
Options
Considered
10
User
Recs.
Oct 27, 2017
Last
Updated
Related Questions
Activity
Have feedback or ideas?
Join our community
on Discord
Ad
3
Options
Considered
Best Node.js test frameworks
Price
Last Updated
--
Mocha
-
Oct 27, 2017
--
Jasmine
-
Oct 9, 2017
--
tape
-
May 2, 2017
See Full List
--
Mocha
My Rec
ommendation
for
Mocha
My Recommendation for
Mocha
All
10
Pros
9
Cons
1
Top
Pro
•••
Supports Promises
You can return a Promise from BDD hook methods (before, beforeEach, after, afterEach) and, with Chai as Promised, you can assert fluently against units under test that return Promises.
See More
Top
Con
•••
Can be intimidating for beginners
While some testing frameworks are complete out of the box, Mocha requires developers to select and set up assertion libraries and mocking utilities. For someone who is just starting to learn how to build tests this can be scary as they will also have to choose which libraries to use and learn them too.
See More
Top
Pro
•••
Makes Asynchronous testing extremely easy
No need to write tricky statements for Async testing. Mocha gives you a done callback. Place this done parameter in your callback function, that'll let Mocha know that you've written an asynchronous function.
See More
Top
Pro
•••
Runs in Node.js and the browser
Mocha has a browser build as well as a node command line program so you can test in client and server side environments.
See More
Top
Pro
•••
Supports different assertion libraries
Mocha runs independently from the assertion library, so you can choose which assertion format works best for you. Mocha most often is run in combination with assertion library Chai.
See More
Top
Pro
•••
Custom full color test reporters
Mocha has multiple test reporters built in and you can create your own as well. The test reporters have full color and makes it easy to see if your tests fail or not.
See More
Top
Pro
•••
Write tests with Behavior Driven Development (BDD)
Allows developers to choose their development process. Not only TDD but also BDD.
See More
Top
Pro
•••
Integrates really well with NodeJS
The Mocha test framework itself runs on NodeJS, hence it makes everything related to it extremely simple. With Mocha's simple syntax and speed, testing your node.js app just got a whole lot easier.
See More
Top
Pro
•••
Supports programatically skipping tests
If your integration tests depend on an external system that may go down, you can programmatically skip tests using this.skip().
See More
Top
Pro
•••
Easy to add support for Generators
Aside from the numerous benefits with generators in your application, You can now also integrate generators into your test suite. By using mocha, all you have to do is enable support for generators.
See More
Hide
See All
Get it
here
Recommend
6
--
Jasmine
My Rec
ommendation
for
Jasmine
My Recommendation for
Jasmine
All
6
Pros
5
Cons
1
Top
Pro
•••
Integrates very well with Ruby on Rails
The jasmine-rails gem allows you to run Jasmine specs in a browser (powered by Rails engine mounted into your application).
See More
Top
Con
•••
Maintainers are not very responsive to pull requests
Pivotal aren't responsive to pull requests, though they have made repo changes within < 3 months
See More
Top
Pro
•••
Easy to find Jasmine tutorials for most MV* frameworks,
whilst Mocha is still considered the new kid on the block.
See More
Top
Pro
•••
Has a very readable and user-friendly syntax
Code readability is an important factor, if the application development involves multiple teams; if the testing team is unable to read your test cases then they won't be able to test it. Jasmine resolves this issue by providing developers with an extremely simple and "human-friendly" syntax.
See More
Top
Pro
•••
Behaviour Driven Development focused
If you prefer your test cases and application to be developed from the perspective of your stake holders, Jasmine is the framework for you.
See More
Top
Pro
•••
Allows both DOM-less as well as Asynchronous testing
If you have some test cases that do not involve testing of DOM elements or events, those are exactly the ones where you want to use Jasmine. It'll provide smooth, simple and easy DOM-less testing of those test cases.
See More
Hide
See All
Get it
here
Recommend
3
--
tape
My Rec
ommendation
for
tape
My Recommendation for
tape
All
5
Pros
4
Cons
1
Top
Pro
•••
Simple API
Very simple API that doesn't require globals, or monkey patching objects for assertions.
See More
Top
Con
•••
No concurrency
Cannot run async test cases concurrently for faster test builds.
See More
Top
Pro
•••
No global functions
Tape does not use global methods such as "it", "describe", since they are not considered best practice in JavaScript.
See More
Top
Pro
•••
Built-in assert
This way you don't have to add more dependencies and external assertion libraries.
See More
Top
Pro
•••
It follows the principles of TAP
TAP: Test Anything Protocol
See More
Hide
See All
Get it
here
Recommend
1
Don't see your favorite option? Add it.
Built By the Slant team
Find the best product instantly.
4.7 star rating
Add to Chrome
Add to Edge
Add to Firefox
Add to Opera
Add to Brave
Add to Safari
Try it now - it's free
One sec!
Are you sure that you want to abandon your hard work?
Delete Work
Continue working
{}
undefined
url next
price drop