summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Warlick <twarlick@gmail.com>2016-07-12 11:38:03 -0400
committerTravis Warlick <twarlick@gmail.com>2016-07-12 11:38:03 -0400
commit89e7020b49662f5b7d52c7f64226ec40ecfde6e7 (patch)
tree8600f0b46cbe77fd81817cedcb837fdb7b9951ea
parentdb8a73799213299bfc5880dea68a15c3f187a9cc (diff)
downloadasync-89e7020b49662f5b7d52c7f64226ec40ecfde6e7.tar.gz
Fix nyc/code-coverage testing -- do not run sub-context tests under nyc. nyc uses a separate contex to track code, so tests using a separate context fail under nyc with errors like the following:
1) parallel parallel call in another context: ReferenceError: __cov_GLCSDG93mVWqRnbTQi1ISfasEto is not defined at evalmachine.<anonymous>:1:16 at evalmachine.<anonymous>:1:569 at ContextifyScript.Script.runInNewContext (vm.js:18:15) at Object.exports.runInNewContext (vm.js:49:17) at Context.<anonymous> (mocha_test/parallel.js:3:954) This commit also removes the redundant `&& nyc report` from the end of the npm coverage script (nyc outputs the report by default).
-rw-r--r--mocha_test/parallel.js2
-rw-r--r--mocha_test/series.js2
-rw-r--r--mocha_test/waterfall.js2
-rw-r--r--package.json4
4 files changed, 5 insertions, 5 deletions
diff --git a/mocha_test/parallel.js b/mocha_test/parallel.js
index bad98af..4f92642 100644
--- a/mocha_test/parallel.js
+++ b/mocha_test/parallel.js
@@ -192,7 +192,7 @@ describe('parallel', function() {
});
});
- it('parallel call in another context', function(done) {
+ it('parallel call in another context @nycinvalid', function(done) {
if (isBrowser()) {
// node only test
done();
diff --git a/mocha_test/series.js b/mocha_test/series.js
index 0237582..80e54c2 100644
--- a/mocha_test/series.js
+++ b/mocha_test/series.js
@@ -137,7 +137,7 @@ describe('series', function() {
});
});
- it('call in another context', function(done) {
+ it('call in another context @nycinvalid', function(done) {
if (isBrowser()) {
// node only test
done();
diff --git a/mocha_test/waterfall.js b/mocha_test/waterfall.js
index 7053b2c..c9abdc9 100644
--- a/mocha_test/waterfall.js
+++ b/mocha_test/waterfall.js
@@ -106,7 +106,7 @@ describe("waterfall", function () {
}).to.throw(/already called/);
});
- it('call in another context', function(done) {
+ it('call in another context @nycinvalid', function(done) {
if (process.browser) {
// node only test
done();
diff --git a/package.json b/package.json
index 2590d97..9a252cb 100644
--- a/package.json
+++ b/package.json
@@ -59,8 +59,8 @@
"yargs": "~3.9.1"
},
"scripts": {
- "coverage": "nyc npm run mocha-node-test && nyc report",
- "coveralls": "npm run mocha-node-test && nyc report --reporter=text-lcov | coveralls",
+ "coverage": "nyc npm run mocha-node-test -- --grep @nycinvalid --invert",
+ "coveralls": "npm run mocha-nyc-test && nyc report --reporter=text-lcov | coveralls",
"jsdoc": "jsdoc -c ./support/jsdoc/jsdoc.json && node support/jsdoc/jsdoc-fix-html.js",
"lint": "eslint lib/ mocha_test/ perf/memory.js perf/suites.js perf/benchmark.js support/build/ support/*.js karma.conf.js",
"mocha-browser-test": "karma start",