diff --git a/.gitignore b/.gitignore index ba2a97b5..1fd04daf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules coverage +.nyc_output diff --git a/.travis.yml b/.travis.yml index 8797713f..7a2ace0c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,9 @@ node_js: - 4 - 6 - node -after_success: ./deploy.sh +after_success: + - npm run coverage + - ./deploy.sh env: global: - COMMIT_AUTHOR_EMAIL: yeoman@yeoman.io diff --git a/gulpfile.js b/gulpfile.js deleted file mode 100644 index 5dbd4226..00000000 --- a/gulpfile.js +++ /dev/null @@ -1,41 +0,0 @@ -'use strict'; -const path = require('path'); -const gulp = require('gulp'); -const mocha = require('gulp-mocha'); -const istanbul = require('gulp-istanbul'); -const plumber = require('gulp-plumber'); -const coveralls = require('gulp-coveralls'); - -gulp.task('pre-test', () => - gulp.src([ - 'lib/**/*.js' - ]) - .pipe(istanbul({includeUntested: true})) - .pipe(istanbul.hookRequire()) -); - -gulp.task('test', ['pre-test'], cb => { - let mochaErr; - - gulp.src('test/*.js') - .pipe(plumber()) - .pipe(mocha({reporter: 'spec', timeout: 3000})) - .on('error', err => { - mochaErr = err; - }) - .pipe(istanbul.writeReports()) - .on('end', () => { - cb(mochaErr); - }); -}); - -gulp.task('coveralls', ['test'], () => { - if (!process.env.CI) { - return; - } - - return gulp.src(path.join(__dirname, 'coverage/lcov.info')) - .pipe(coveralls()); -}); - -gulp.task('default', ['test', 'coveralls']); diff --git a/package.json b/package.json index 49b5af68..2cbd18ea 100644 --- a/package.json +++ b/package.json @@ -12,9 +12,10 @@ }, "scripts": { "pretest": "xo", - "test": "gulp", + "test": "nyc mocha", "doc": "jsdoc -c jsdoc.json", - "prepublish": "nsp check" + "prepublish": "nsp check", + "coverage": "nyc report --reporter=text-lcov | coveralls" }, "files": [ "lib" @@ -60,16 +61,13 @@ "yeoman-environment": "^1.1.0" }, "devDependencies": { - "gulp": "^3.6.0", - "gulp-coveralls": "^0.1.0", - "gulp-istanbul": "^1.0.0", - "gulp-mocha": "^3.0.1", - "gulp-plumber": "^1.0.0", + "coveralls": "^2.13.1", "inquirer": "^3.0.1", "jsdoc": "^3.3.0-beta1", "mockery": "^2.0.0", "nock": "^9.0.5", "nsp": "^2.8.0", + "nyc": "^11.2.1", "proxyquire": "^1.0.0", "sinon": "^2.1.0", "tui-jsdoc-template": "^1.0.4",