A grunt wrapper for nyc
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-simple-nyc --save-dev
Alternatively, install task-master and let it manage this for you.
The "nyc" task
In your project's Gruntfile, add a section named
nyc to the data object passed into
grunt.initConfig(). This task is a simple-cli task, so it can be configured in accordance with the examples there. A simple example is:
grunt;// grunt nyc:cover will run// nyc --cwd server --include lib/** --include routes/** --exclude *.test.*// --reporter--reporter--reporter--reporter lcov --reporter text-summary// --report-dir server/coverage --all grunt mocha:unit//// whereas grunt nyc:report will run// nyc report --reporter text-summary
If you need to pass arguments to the process that runs your tests (
grunt mocha:unit in the example above), you need to add them to
args after the command name (alternatively, you can add them in
Please see the contribution guidelines.