JavaScript test coverage made simple.

How Istanbul works

Istanbul instruments your ES5 and ES2015+ JavaScript code with line counters, so that you can track how well your unit-tests exercise your codebase.

The nyc command-line-client for Istanbul works well with most JavaScript testing frameworks: tap, mocha, AVA, etc.

#Features

  • First class support of ES6/ES2015+ using babel-plugin-istanbul.
  • A collection of reporters, providing both terminal and HTML output: terminal output browser output
  • Support for the most popular JavaScript testing frameworks (see our tutorials).
  • Support for instrumenting subprocesses, using the nyc command-line-interface.

Quick Start

Adding coverage to your mocha tests could not be easier

$ npm install --save-dev nyc

Now, simply place the command nyc in front of your existing test command, for example:

{
  "scripts": {
    "test": "nyc mocha"
  }
}