Permalink
Browse files

Add ava and nyc configuration

  • Loading branch information...
1 parent 08df3cf commit 4f0e2cde7af6ec084e3e4e61615b945f5db27731 @micaelmbagira micaelmbagira committed Jun 27, 2016
Showing with 21 additions and 24 deletions.
  1. +1 −0 .gitignore
  2. +7 −21 gulpfile.js
  3. +13 −3 package.json
View
@@ -1,2 +1,3 @@
node_modules
coverage
+.nyc_output
View
@@ -3,17 +3,14 @@
const path = require('path');
const gulp = require('gulp');
const eslint = require('gulp-eslint');
+const spawn = require('cross-spawn');
const excludeGitignore = require('gulp-exclude-gitignore');
-const mocha = require('gulp-mocha');
-const istanbul = require('gulp-istanbul');
const nsp = require('gulp-nsp');
-const plumber = require('gulp-plumber');
gulp.task('nsp', nodeSecurityProtocol);
gulp.task('watch', watch);
gulp.task('static', eslintCheck);
-gulp.task('pre-test', istanbulCover);
-gulp.task('test', gulp.series('pre-test', mochaTest));
+gulp.task('test', gulp.series([avaTest, nycReport]));
gulp.task('prepublish', gulp.series('nsp'));
gulp.task('default', gulp.series('static', 'test'));
@@ -30,25 +27,14 @@ function eslintCheck() {
.pipe(eslint.failAfterError());
}
-function istanbulCover() {
- return gulp.src(['**/*.js', '!**/templates/**'])
- .pipe(excludeGitignore())
- .pipe(istanbul({
- includeUntested: true
- }))
- .pipe(istanbul.hookRequire());
+function avaTest() {
+ return spawn('./node_modules/.bin/nyc', ['--all', '--reporter=lcov', './node_modules/.bin/ava'], {stdio: 'inherit'});
}
-function mochaTest() {
- return gulp.src('test/**/*.js')
- .pipe(plumber())
- .pipe(mocha({reporter: 'spec'}))
- .once('error', () => {
- process.exit(1);
- })
- .pipe(istanbul.writeReports());
+function nycReport() {
+ return spawn('./node_modules/.bin/nyc', ['report', '--colors'], {stdio: 'inherit'});
}
function watch() {
- gulp.watch('**/*.js', ['test']);
+ return spawn('./node_modules/.bin/nyc', ['--all', '--reporter=lcov', './node_modules/.bin/ava', '--watch'], {stdio: 'inherit'});
}
View
@@ -33,17 +33,27 @@
"yosay": "^1.1.1"
},
"devDependencies": {
+ "ava": "^0.15.2",
"babel-eslint": "^6.0.2",
+ "chai": "^3.5.0",
+ "chai-spies": "^0.7.1",
+ "cross-spawn": "^4.0.0",
"eslint": "^2.7.0",
"eslint-config-xo-space": "^0.12.0",
"eslint-plugin-babel": "^3.2.0",
"gulp": "gulpjs/gulp#4.0",
"gulp-eslint": "^2.0.0",
"gulp-exclude-gitignore": "^1.0.0",
- "gulp-istanbul": "^0.10.2",
- "gulp-mocha": "^2.1.3",
"gulp-nsp": "^2.3.0",
- "gulp-plumber": "^1.0.1"
+ "nyc": "^6.6.1"
+ },
+ "nyc": {
+ "include": [
+ "generators/**/*.js"
+ ],
+ "exclude": [
+ "generators/**/templates/**"
+ ]
},
"scripts": {
"test": "gulp",

0 comments on commit 4f0e2cd

Please sign in to comment.