Grunt task for running mocha specs in a headless browser (PhantomJS) and generating code coverage from Istanbul instrumented source
Clone or download
Pull request Compare This branch is 4 commits ahead, 20 commits behind scotthogan:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
example
growl
phantomjs
support
tasks
.gitignore
.jshintrc
.travis.yml
AUTHORS
CONTRIBUTING.md
Gruntfile.js
HISTORY.md
LICENSE-MIT
README.md
package.json

README.md

grunt-mocha-phantom-istanbul

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.

Settings

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

options.coverage

The options for this are specified in the coverage object.

options.coverage.coverageFile

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

The file to write the coverage json data to.

Example:

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

options.coverage.dir

Type: String

The directory to write a full lcov coverage report.

Example:

mocha: {
  test: {
    files: ['tests/**/*.html'],
    options: {
      coverage: {
        dir: 'somePath'
      }
    }
  },
},

License

Licensed under the MIT license.