Need advice about which tool to choose?Ask the StackShare community!

Mocha

8.7K
2.9K
+ 1
430
Nightwatchjs

178
323
+ 1
11
Add tool

Mocha vs Nightwatchjs: What are the differences?

Developers describe Mocha as "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. On the other hand, Nightwatchjs is detailed as "Automated testing and continous integration framework based on node.js and selenium webdriver". Nightwatch.js is an easy to use Node.js based End-to-End (E2E) testing solution for browser based apps and websites. It uses the powerful Selenium WebDriver API to perform commands and assertions on DOM elements.

Mocha can be classified as a tool in the "Javascript Testing Framework" category, while Nightwatchjs is grouped under "Browser Testing".

Some of the features offered by Mocha are:

  • browser support
  • simple async support, including promises
  • test coverage reporting

On the other hand, Nightwatchjs provides the following key features:

  • e2e
  • test
  • javascript

Mocha and Nightwatchjs are both open source tools. Mocha with 18.1K GitHub stars and 2.44K forks on GitHub appears to be more popular than Nightwatchjs with 9.43K GitHub stars and 925 GitHub forks.

Coursera, Asana, and Typeform are some of the popular companies that use Mocha, whereas Nightwatchjs is used by WebbyLab, UniSharp, and GoEuro. Mocha has a broader approval, being mentioned in 400 company stacks & 272 developers stacks; compared to Nightwatchjs, which is listed in 16 company stacks and 5 developer stacks.

Decisions about Mocha and Nightwatchjs

We use Mocha for our FDA verification testing. It's integrated into Meteor, our upstream web application framework. We like how battle tested it is, its' syntax, its' options of reporters, and countless other features. Most everybody can agree on mocha, and that gets us half-way through our FDA verification and validation (V&V) testing strategy.

See more
Manage your open source components, licenses, and vulnerabilities
Learn More
Pros of Mocha
Pros of Nightwatchjs
  • 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
  • 3
    Open source
  • 2
    Testing
  • 2
    Automates browsers
  • 1
    Better cross browser (use selenium)
  • 1
    Cross-Browser Testing
  • 1
    Multiple Browser Support
  • 1
    Parallel Test Running

Sign up to add or upvote prosMake informed product decisions

Cons of Mocha
Cons of Nightwatchjs
  • 3
    Cannot test a promisified functions without assertion
  • 2
    No assertion count in results
  • 1
    Not as many reporter options as Jest
  • 2
    No automatic wait
  • 1
    Less flexibility
  • 1
    Limited native mobile app support
  • 1
    Limited browser support
  • 1
    Configuration complexity

Sign up to add or upvote consMake informed product decisions

- No public GitHub repository available -

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.

What is Nightwatchjs?

Nightwatch.js is an easy to use Node.js based End-to-End (E2E) testing solution for browser based apps and websites. It uses the powerful Selenium WebDriver API to perform commands and assertions on DOM elements.

Need advice about which tool to choose?Ask the StackShare community!

What companies use Mocha?
What companies use Nightwatchjs?
Manage your open source components, licenses, and vulnerabilities
Learn More

Sign up to get full access to all the companiesMake informed product decisions

What tools integrate with Mocha?
What tools integrate with Nightwatchjs?

Sign up to get full access to all the tool integrationsMake informed product decisions

Blog Posts

JavaScriptGitHubNode.js+29
14
13630
JavaScriptGitGitHub+33
20
2140
What are some alternatives to Mocha and Nightwatchjs?
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.
Jest
Jest provides you with multiple layers on top of Jasmine.
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.
Git
Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.
GitHub
GitHub is the best place to share code with friends, co-workers, classmates, and complete strangers. Over three million people use GitHub to build amazing things together.
See all alternatives