diff --git a/.gitignore b/.gitignore index fa0fb13984..7e25e4ad05 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ dist /packages/*/lib _babel.github.io /tests/.browser-build.js +.nyc_output diff --git a/.istanbul.yml b/.istanbul.yml deleted file mode 100644 index 6489c5aeff..0000000000 --- a/.istanbul.yml +++ /dev/null @@ -1,5 +0,0 @@ -instrumentation: - root: . - excludes: - - "**/node_modules/**" - - "scripts/*.js" diff --git a/Gulpfile.js b/Gulpfile.js index 54f20cafb8..739effe47d 100644 --- a/Gulpfile.js +++ b/Gulpfile.js @@ -9,7 +9,6 @@ var gulp = require("gulp"); var path = require("path"); var scripts = "./packages/*/src/**/*.js"; -var dest = "packages"; var srcEx, libFragment; @@ -21,6 +20,9 @@ if (path.win32 === path) { libFragment = "$1/lib/"; } +var mapToDest = function (path) { return path.replace(srcEx, libFragment); }; +var dest = "packages"; + gulp.task("default", ["build"]); gulp.task("build", function () { @@ -30,17 +32,17 @@ gulp.task("build", function () { gutil.log(err.stack); } })) + .pipe(newer({map: mapToDest})) .pipe(through.obj(function (file, enc, callback) { - file._path = file.path; - file.path = file.path.replace(srcEx, libFragment); - callback(null, file); - })) - .pipe(newer(dest)) - .pipe(through.obj(function (file, enc, callback) { - gutil.log("Compiling", "'" + chalk.cyan(file._path) + "'..."); + gutil.log("Compiling", "'" + chalk.cyan(file.path) + "'..."); callback(null, file); })) .pipe(babel()) + .pipe(through.obj(function (file, enc, callback) { + file._path = file.path; + file.path = mapToDest(file.path); + callback(null, file); + })) .pipe(gulp.dest(dest)); }); diff --git a/Makefile b/Makefile index 65fd96a276..46bcc392da 100644 --- a/Makefile +++ b/Makefile @@ -52,13 +52,13 @@ test: lint test-only test-cov: clean # rebuild with test rm -rf packages/*/lib - BABEL_ENV=test; ./node_modules/.bin/gulp build + BABEL_ENV=test ./node_modules/.bin/gulp build ./scripts/test-cov.sh test-ci: NODE_ENV=test make bootstrap - ./scripts/test-cov.sh - cat ./coverage/coverage.json | ./node_modules/codecov.io/bin/codecov.io.js + make test-cov + ./node_modules/.bin/codecov -f coverage/coverage-final.json publish: git pull --rebase diff --git a/package.json b/package.json index a725535bd9..e62332ff19 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "async": "^1.5.0", "babel-core": "^6.13.2", "babel-eslint": "^7.0.0", + "babel-plugin-istanbul": "^2.0.1", "babel-plugin-transform-class-properties": "^6.6.0", "babel-plugin-transform-flow-strip-types": "^6.3.13", "babel-plugin-transform-runtime": "^6.3.13", @@ -22,7 +23,7 @@ "bundle-collapser": "^1.2.1", "chai": "^3.5.0", "chalk": "1.1.1", - "codecov.io": "^0.1.6", + "codecov": "^1.0.1", "derequire": "^2.0.2", "eslint": "^3.9.0", "eslint-config-babel": "^2.0.1", @@ -35,11 +36,11 @@ "gulp-plumber": "^1.0.1", "gulp-util": "^3.0.7", "gulp-watch": "^4.3.5", - "istanbul": "^0.4.5", "lerna": "2.0.0-beta.23", "lerna-changelog": "^0.2.0", "lodash": "^4.2.0", "mocha": "^3.0.0", + "nyc": "^10.0.0", "output-file-sync": "^1.1.1", "rimraf": "^2.4.3", "semver": "^5.0.0", @@ -65,8 +66,20 @@ ], "env": { "test": { - "auxiliaryCommentBefore": "istanbul ignore next" + "auxiliaryCommentBefore": "istanbul ignore next", + "plugins": [ + "istanbul" + ] } } + }, + "nyc": { + "all": true, + "exclude": [ + "scripts/*.js", + "packages/*/test/**" + ], + "sourceMap": false, + "instrument": false } } diff --git a/scripts/test-cov.sh b/scripts/test-cov.sh index 033f40dbc7..9be6c933c4 100755 --- a/scripts/test-cov.sh +++ b/scripts/test-cov.sh @@ -1,4 +1,5 @@ #!/bin/sh set -e -node node_modules/istanbul/lib/cli.js cover node_modules/mocha/bin/_mocha -- `scripts/_get-test-directories.sh` --opts test/mocha.opts +node_modules/.bin/nyc node_modules/mocha/bin/_mocha --opts test/mocha.opts `scripts/_get-test-directories.sh` +node_modules/.bin/nyc report --reporter=json