Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Grunt task to instrument JavaScript files.
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
bin
tasks
test
.gitignore
.npmignore
.travis.yml
LICENSE-MIT
README.md
grunt.js
package.json

README.md

grunt-cover Build Status NPM version

Grunt task to instrument JavaScript files using coverjs.

Getting Started

Install this grunt plugin next to your project's grunt.js gruntfile with: npm install grunt-coverjs

Then add this line to your project's grunt.js gruntfile:

grunt.loadNpmTasks('grunt-coverjs');

Documentation

Inside your project's grunt.js gruntfile, add a section named cover.

The cover section has a compile parameter, inside which you list the files to be instrumented:

    cover: {
      compile: {
        files: {
          'instrumented/testCoverage.js': ['test/fixtures/testCoverage.js'],
          'instrumented/testDir/*.js': ['test/fixtures/testCoverage2.js', 'test/fixtures/nested/testCoverage3.js']
        }
      }
    }

When the task runs, the files will be instrumented and placed in the specifed path.

Something went wrong with that request. Please try again.