node package manager
We need your input. Help make JavaScript better: Take the 2017 JavaScript Ecosystem survey »


# grunt-qunit-cov

Grunt plugin for qunit unit test with coverage

Getting Started

This plugin has two external dependencies, both must be downloaded, extracted and registered in the PATH environment variable:

  1. PhantomJs
  2. JsCoverage

Install the module with: npm install grunt-unit-cov

Then load it from your own grunt.js file:



This plugin provides one task: qunit-cov. It's multi tasks, meaning that grunt will automatically iterate over all qunit-cov targets if a target is not specified.


This is similar to the built-in qunit task, though the configuration is different. Here's an example:

"qunit-cov": {
    minimum: 0.9,
    srcDir: 'src',
    depDirs: ['3rd', 'test', 'css'],
    outDir: 'testResults',
    testFiles: ['test/*.html']

minimum specifies the minimum coverage of all files to task pass, srcDir the directory to be instrumented by jscoverage and copied to outDir, depDirs the dependencies directory list will be copied to outDir and testFiles parameter is a list of all files to be tested with qunit.

After running there will be a folder called out inside the outDir specified with coverage.html, which contains the summary of execution and other files of the srcDir.


Please use the issue tracker and pull requests.


Copyright (c) 2012 Afonso França Licensed under the MIT license.