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
What is the best alternative to Jasmine?
Ad
Ad
Mocha
All
9
Experiences
Pros
7
Cons
2
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
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
Write tests with Behavior Driven Development (BDD)
Allows developers to choose their development process. Not only TDD but also BDD.
See More
Top
Con
No atomic tests
Tests cannot be ran in random order.
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
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
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
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
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
Experiences
Get it
here
110
6
tape
All
5
Experiences
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
Built-in assert
This way you don't have to add more dependencies and external assertion libraries.
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
It follows the principles of TAP
TAP: Test Anything Protocol
See More
Hide
Get it
here
40
2
Jest
All
5
Experiences
Pros
4
Cons
1
Top
Pro
Easy to use
One of Jest's philosophies is to provide an integrated “zero-configuration” experience. Eg: it provides assertion library by default.
See More
Top
Con
Not beginner-friendly
If you're new to unit testing and are trying to understand unit testing within the React ecosystem, specifically ReactNative, it is going to be a challenge. The Jest doc dives right into making tests without any primer on how to go from concept to implementation.
See More
Top
Pro
Well documented
See More
Top
Pro
Recommended for React testing
Jest is the recommended unit testing framework by Facebook. It's also the one used by Facebook developers when working with React projects.
See More
Top
Pro
Snapshot testing is convinient
It's great for testing UI. It is also convenient for asserting complex data objects, as it doesn't require developers to manually compose the expected value.
See More
Hide
Get it
here
38
1
QUnit
All
4
Experiences
Pros
3
Cons
1
Top
Pro
Tests run in the order they're added to the suite
In cases where you want (I know your test cases must be atomic) where you really really want your test cases to run in a specific order, maybe if the current one rely on those of previous case, you can use Qunit by setting QUnit.config.reorder = false and your test cases will run in the order you've provided.
See More
Top
Con
Testing of Async operations can be a little tough at times.
Qunit, expects us to call the start() function before the Async function itself, and stop() after it stops. This can be a problem when you have no way of knowing, when your function will start or stop (your testing a number of dependent functions)
See More
Top
Pro
Works really well if performing DOM Testing
All frontend developers already know the ease that jQuery framework has brought to their lives, in handling DOM events and accessing elements. Since Qunit was built as a part of jquery (is even used by jQuery itself for unit testing) hence it makes testing of DOM elements a lot easier.
See More
Top
Pro
Extremely easy to start from scratch
Seriously! All you have to do is include the Qunit library from the CDN, then create your Testcases js file, and RUN IT! . Your outputs would be displayed in a pretty little format in your browser.
See More
Hide
Get it
here
8
5
Nightwatch.js
All
6
Experiences
Pros
4
Cons
2
Top
Pro
You don't have to choose a testing framework
Nightwatch solves the Paradox of Choice among testing frameworks such as Jasmine, Cucumber or Mocha+Chai, by including its own BDD-style assertion library, based on Chai.
See More
Top
Con
No official BDD-style syntax support
See More
Top
Pro
Includes its own testing framework / assertions library
See More
Top
Con
Includes its own testing framework / assertions library
Unlike WebdriverIO, which lets you use various test frameworks and assertion libraries (e.g. Jasmine, Cucumber, Mocha + Chai), Nightwatch comes with its own BDD-style interface for performing assertions, based on Chai. Here's a simple test example: module.exports = { 'Demo test Google' : function (browser) { browser .url('http://www.google.com') .waitForElementVisible('body', 1000) .setValue('input[type=text]', 'nightwatch') .waitForElementVisible('button[name=btnG]', 1000) .click('button[name=btnG]') .pause(1000) .assert.containsText('#main', 'Night Watch') .end(); } };
See More
Top
Pro
Test organization is out of the box
Supports page object model, custom commands, custom assertions, and globals.js.
See More
Top
Pro
3rd party integration with Cucumber
Though Cucumber is not officially supported, Nightwatch can be used with Cucumber.
See More
Hide
Get it
here
31
3
Cypress
All
7
Experiences
Pros
4
Cons
3
Top
Pro
Web UI to develop tests quickly
You can edit your test code in the browser and instantly see it run as you change the code.
See More
Top
Con
Doesn't support Safari
See More
Top
Pro
Easy to record a video
It can easily record a video so you can understand what happened when a test failed in your CI.
See More
Top
Con
Single tab only
Does not and will not support multiple tabs or multiple simultaneous browsers. See https://docs.cypress.io/guides/references/trade-offs.html#Permanent-trade-offs-1
See More
Top
Pro
Amazing dashboard to view reports and recordings
The Cypress dashboard allows you to see every run on a great UI linked to commits and gitflow.
See More
Top
Con
Heavy in setup
Do not add Cypress in the main repo. Have a specific test repo for it or you will be sorry when the CI/CD flow takes 5-6 min longer every build due to installation time of Cypress.
See More
Top
Pro
Cross Browser testing
https://docs.cypress.io/guides/guides/cross-browser-testing.html Chrome Firefox Edge Electron Brave
See More
Hide
See All
Experiences
Get it
here
59
8
CasperJS
All
7
Experiences
Pros
5
Cons
2
Top
Pro
Allows screenshots (either the full page or parts of it) if performing UI testing
There are times where you don't want to open up a browser for screencaps, that is where CasperJS comes to use, it can render the page using its own rendering engine and take and save a screenshot for you, all via the commandline
See More
Top
Con
Not for unit testing but rather UI testing
These are two extremely different concepts. CasperJS should be removed from this list
See More
Top
Pro
Easy to understand
See More
Top
Con
Cannot guarantee 100% accurate Webkit-based browser screenshots
QtWebKit is the rendering engine used by CasperJS. Keep in mind this is NOT the same rendering engine as Chrome; hence, if you want to be 100% sure of the results, you must run a Webkit browser (such as Chrome) yourself.
See More
Top
Pro
Written in JavaScript
Since all webdevs know JS, the start-up time of learning the framework will be reduced to zero, as your team can be productive from day one.
See More
Top
Pro
Easily integrates with other applications
Due to the simplicity of the framework, not only other libraries can be built with it, but it can be integrated with any web application as well.
See More
Top
Pro
Can run javascript code inside pages being tested
Can execute arbitrary javascript or load external JS into the page being tested. This feature is possible due to the presence of a rendering engine, and helps you see the effects of any client side scripting during your tests.
See More
Hide
See All
Experiences
Get it
here
15
3
BusterJS
All
6
Experiences
Pros
4
Cons
2
Top
Pro
Supports deferring tests
No need to comment out your entire test case, now that you have Buster, which supports deferring a test so it doesn't actually run, but you get notified that there’s a deferred tests every time you run your test suite.
See More
Top
Con
Has no plugins for major IDE's (Eclipse/IntelliJ) yet.
Do you prefer running your test cases from inside your IDE? well BusterJS will make that a lot difficult for you if not impossible. You'll have to run Buster using the good old way of spawning up a new terminal for running the tests.
See More
Top
Pro
Flexible; extend it to wrap other test-frameworks
Have your test cases written in another framework, want to use BusterJS to run the tests, then you're in luck. BusterJS can be easily wrapped around other test frameworks. If you need to know how to do it, here's a link that showing just that.
See More
Top
Con
Currently still in Beta; some of the stuff still has bugs
Time of writing : 31st July 2014
See More
Top
Pro
Has support for NodeJS testing.
Working on a NodeJS app? BusterJS can help you Unit test it. This pretty much works just like browser tests, but you need to require Buster.JS in your tests.
See More
Top
Pro
You have the option of either running tests headless or via the browser
Don't have time to go through the lengthy process of opening up your browsers? BusterJS gives you the option of performing Headless tests. These are powered by PhantomJS; hence all your testing is done within the command line.
See More
Hide
Get it
here
2
0
livedoc-mocha
All
5
Experiences
Pros
3
Cons
2
Top
Pro
Great looking test output
See More
Top
Con
Not great for Teams that don't value testing
As this takes more effort (ie you need to think harder about the test/spec) to write good tests. We found some team members didn't like it. If your team thinks tests are a tax, better to go with a simpler option like mocha.
See More
Top
Pro
Loads of options and create your own reports if needed
You can create your own reports as it can output the results in JSON. Not done it ourselves yet, but could be useful.
See More
Top
Con
To get maximum benefit need to write using Gherkin
The Gherkin language is a lot more verbose than what devs are used to writing in.
See More
Top
Pro
Powerful implementation of the Gherkin Spec
See More
Hide
FREE
1
0
Karma
All
7
Experiences
Pros
5
Cons
2
Top
Pro
Easily extensible
Do you prefer other test frameworks such as Mocha, Jasmine, qUnit or any other framework? Well you're in luck as Karma can be easiliy be extended to wrap around ANY framework of your choice.
See More
Top
Con
No Support for NodeJS testing
Currently Karma doesn't support testing of apps built on NodeJS. So if you have a node app, you don't want to use Karma, Mocha or Jasmine can do the job for you.
See More
Top
Pro
Provides both Browser based testing as well as headless tests
Karma eases out the UI testing process as you can test your code on all your devices let it be smartphones, tablets or your very own desktop. If you don't want all of that, you always have the option of headless testing using a PhantomJS instance.
See More
Top
Con
No plugin for Eclipse (yet)
Do most of your code using Eclipse, well, you're in bad luck. Karma doesn't have an eclipse plugin, though if you are a real die hard eclipse fan, you can see this little hack to be able to run Karma from inside Eclipse Link (Time of writing: July 2014)
See More
Top
Pro
Provides the option of running client/servers either separately or on the Development computer
These options are really helpful in cases, where you have the luxury of multiple machines (tablets, mobile phones desktops) around you.
See More
Top
Pro
You can test your code in cross browser environments
Being able to test your code directly via your testing tool is a breeze! You don't need to download a fancy tool to see how your app looks in a number of different browsers, now that Karma would do the job for you.
See More
Top
Pro
Has plugins for WebStorm and is supported by the Netbeans IDE
Thanks to Karma, you won't need to spawn up a new terminal just so that you can test your app, you can now code and test right from the IDE
See More
Hide
See All
Experiences
Get it
here
5
4
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
{}
undefined
url next
price drop