From 7044daad9acc51d5384acda81792940b58513561 Mon Sep 17 00:00:00 2001 From: Wolfgang Faust Date: Thu, 2 Mar 2017 13:55:06 -0500 Subject: [PATCH 1/2] Fix tests failing during `npm run coverage` It seems that they were running in the wrong order, which caused problems where some tests depended on other tests that hadn't run yet. I therefore added copied '-S' flag from the test script to the coverage script. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6b269408..a00bd928 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ "scripts": { "test": "node ./node_modules/mocha/bin/mocha --require use-strict -S -R spec ./test/*.js", "start": "node example/server.js", - "coverage": "istanbul cover ./node_modules/mocha/bin/_mocha -- -R spec", + "coverage": "istanbul cover ./node_modules/mocha/bin/_mocha -- -S -R spec", "complexity": "node ./node_modules/plato/bin/plato -r -d complexity lib", "performance": "node --allow-natives-syntax --harmony ./node_modules/mocha/bin/_mocha -S --reporter mocha-performance ./test/*.js", "lint": "node ./node_modules/eslint/bin/eslint ./example ./lib ./test --quiet && echo '✔ All good!'", From f51af048747386b87d807234d2052481c9589b8c Mon Sep 17 00:00:00 2001 From: Wolfgang Faust Date: Thu, 2 Mar 2017 13:56:09 -0500 Subject: [PATCH 2/2] Update documentation on where to find the coverage reports. This location was changed by c2a511a Fixing up the contributing doc (which changed the generator from the html-cov reporter to Istanbul), but the docs weren't updated at the time. --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ed63798f..3fd6452d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -34,7 +34,7 @@ npm test To check the code coverage is still great: ``` npm run coverage -google-chrome ./coverage.html +google-chrome ./coverage/lcov-report/index.html ``` To see code complexity statistics: