Grunt task for the nyc code coverage tool.
This plugin requires Grunt ~0.4.2
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-nyc --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-nyc');
In your project's Gruntfile, the nyc
task is available to use.
You can run grunt nyc
standalone
Or add it to an existing task: grunt.registerTask('test', ['clean', 'nyc']);
Passing options to nyc
's executable.
// cache directory for nyc
tempDirectory: './.nyc_output',
// use any reporters that are supported by istanbul
reporter: 'text',
// modules to require and run through nyc
require: []
Please refer to the readme of nyc
on how to exclude files or on how to configure istanbul.
An example configuration can be found here and if you want to check the options you might want to check the Gruntfile itself.
Developing on the task alone is fairly easy just git clone https://github.com/tdeekens/grunt-nyc.git
then cd grunt-nyc
. From there one has to link the package to itself via npm link && npm link grunt-nyc
which will allow for calling grunt dev
. Now just work the task/nyc.js
and check results - feel free to submit a pull-request!
- 0.0.0 Development, do not use!
- ...to great people around me supporting me with ideas and feedback!