gulp-test-rigging
v0.1.3
Published
Defines a set of Gulp tasks for running unit tests, code-coverage reports, and linting.
Downloads
1
Readme
gulp-test-rigging
Simple Node.js library to simplify generating reports on unit tests, code-coverage, and code styling locally and in files consumable by Jenkins. Uses mocha, istanbul, and xo.
Install
npm install --save gulp-test-rigging
Usage
To use the module, simply require it in your gulpfile.js after "gulp" and pass "gulp" as a parameter.
var gulp = require('gulp');
require('gulp-test-rigging')(gulp);
gulp.task('default', ['validate']);
This adds the following tasks to your gulpfile:
- run-lint - Runs xo on your source files and prints results to the console.
- run-lint-jenkins - Runs xo on your source files and outputs the results to a file.
- run-tests - Runs mocha and istanbul, printing results to the console.
- run-tests-jenkins - Runs mocha and istanbul, outputting the results for each to files.
- validate - Runs both "run-lint" and "run-tests".
- validate-jenkins - Runs both "run-lint-jenkins" and "run-tests-jenkins".
- watch-lint - Runs "run-lint" as a Gulp watch task.
- watch-tests - Runs "run-tests" as a Gulp watch task.
- watch-validate - Runs "validate" as a Gulp watch task.
Options
Options may be passed to the module following the "gulp" parameter in the require statement. The following lists the available options and their default values:
{
paths: {
src: ['app.js'],
test: ['test/**/*spec.js', 'test/**/*test.js']
},
lintReporter: 'checkstyle',
lintOutputDir: './lint-results',
lintOutputFile: 'results.xml',
testOutputDir: './test-results',
testOutputFile: 'results.xml',
coverageReporter: 'mocha-jenkins-reporter',
coverageOutputFormat: ['cobertura']
}
License
Licensed under the MIT license.