If you are just starting your JavaScript application development, you will need to write tests for your code. To help you with that, I’ve filtered an ordered (better ones on top) list of consideration-worth tools from Node.JS modules and Google. If you found a bug (there is a good tool not mentioned here, some tool is not working, etc.) in this post, please report it by writing a comment. CLI marks that the candidate has command line tool to run and display test results. WIP marks that the candidate is under heavy development.

Browser Acceptance Testing

  1. zombie is a lightweight framework for testing client-side JavaScript code in a simulated environment.
  2. tobi allows you to test your web application as if it were a browser.
  3. soda (and soda-runner) is a light-weight Selenium RC client for Node.JS with additional Sauce Labs integration for acceptance testing in the cloud.
  4. js-test-driver is a test runner which easily integrates with continuous builds systems and allows running tests on multiple browsers quickly to ease TDD style development.

Generic TDD and BDD

  1. mocha is a simple, flexible, fun JavaScript test framework for Node.JS and the browser. tutorial
  2. Vows gives you synchronous behaviour driven development for Node.JS. CLI
  3. should.js is an expressive, readable, test framework agnostic, assertion library for Node.JS.
  4. shoulda.js is a micro JavaScript unit testing framework inspired by Shoulda for Ruby.
  5. Chai is a BDD / TDD assertion library for node and the browser that can be delightfully paired with any javascript testing framework
  6. Nodeunit provides easy async unit testing for Node.JS and the browser. CLI
  7. node-qunit is a port of QUnit unit testing framework to Node.JS. CLI
  8. Cucumber.js is the popular Behaviour-Driven Development tool, brought to your JavaScript stack. It runs on both Node.JS and modern web browsers. CLI WIP
  9. kyuri is a Node.JS Cucumber implementation with a few extra asynchronous keywords. It supports 160+ languages and exports to VowsJS stubs.
  10. jasmine (and jasmine-node, and jessie) is a behavior-driven development framework for testing your JavaScript code. CLI (used by jmpress.js)
  11. node-stories gives you lightweight Given/When/Then/And/But blocks with async-support for Node.JS.
  12. patr is a very simple, easy-to-use test runner that support asynchronous JavaScript testing with promises. Part of Persevere project.
  13. YUI Test is a testing framework for browser-based JavaScript solutions.
  14. Buster.JS is a JavaScript test framework for node and browsers.
  15. Testosterone allows you to follow BDD or TDD on any of your projects using the same testing library. CLI
  16. whiskey is a powerful test runner for Node.JS applications. CLI
  17. Twerp is a really simple, class based testing framework for Node.JS and CoffeeScript. CLI

Mocking

  1. Sinon.JS gives you standalone and test framework agnostic test spies, stubs and mocks.
  2. Gently helps with stubbing and behavior verification. It allows you to test the most remote and nested corners of your code while keeping being fully unobtrusive.
  3. Nock is an HTTP mocking and expectations library for Node.JS.
  4. Node Mock is a very simple to use mocking framework which can be used to mock functions in JavaScript objects. NodeMock creates mock methods in less code with more expressive manner.
  5. Horaa mocks internal Node.JS modules.
  6. Mockery lets you work more easily with your framework of choice (or no framework) to get your mocks hooked in to all the right places in the code you need to test. Not a mocking framework.
  7. Node Replay records and replays HTTP responses like a boss!!!11
  8. httpmock is a library for stubbing out web services without changing the system under test. It’s designed for functional testing.
  9. tbd allows you to generate some test data quickly and painlessly. Works with Node.JS and browser.
  10. MaryJane is a mock objects library for javascript, inspired heavily by Mockito. It uses the Arrange-Act-Assert pattern.

Continuous Integration

  1. TestSwarm (and a plugin for Jenkins jenkins-testswarm) gives you distributed continuous integration (used by jQuery at swarm.jquery.org).