Grunt task for running mocha specs in a headless browser (PhantomJS) and generating code coverage from Istanbul instrumented source


Automatically run client-side mocha specs via grunt/mocha/PhantomJS and support tracking code coverage with istanbul.

This is a very slight modification of grunt-mocha which only adds the capability to extract istanbul coverage data, so see grunt-mocha for usage and options.

See grunt-mocha for all additional options that it supports.

The options for this are specified in the coverage object.

Type: String Default: 'coverage/coverage.json'

The file to write the coverage json data to.


mocha: {
  test: {
    files: ['tests/**/*.html'],
    options: {
      coverage: {
        coverageFile: 'somePath/myCoverage.json'

Licensed under the MIT license.