From 5229cc0dd6136ff917af0a6084a1557ec201e7ae Mon Sep 17 00:00:00 2001 From: Mark Larah Date: Mon, 10 Apr 2017 14:09:02 +0100 Subject: [PATCH] Add sourcemaps to code coverage reports - Switch to nyc - Update thresholds --- .gitignore | 3 ++- .istanbul.yml | 6 ------ .nycrc | 17 +++++++++++++++++ package.json | 8 ++++---- 4 files changed, 23 insertions(+), 11 deletions(-) delete mode 100644 .istanbul.yml create mode 100644 .nycrc diff --git a/.gitignore b/.gitignore index 2d6d1a7..ebdac85 100644 --- a/.gitignore +++ b/.gitignore @@ -11,8 +11,9 @@ pids # Directory for instrumented libs generated by jscoverage/JSCover lib-cov -# Coverage directory used by tools like istanbul +# Coverage directories used by tools like nyc coverage +.nyc_output # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) .grunt diff --git a/.istanbul.yml b/.istanbul.yml deleted file mode 100644 index 78375cd..0000000 --- a/.istanbul.yml +++ /dev/null @@ -1,6 +0,0 @@ -reporting: - watermarks: - statements: [50, 77] - functions: [50, 74] - branches: [50, 52] - lines: [50, 82] diff --git a/.nycrc b/.nycrc new file mode 100644 index 0000000..614f79a --- /dev/null +++ b/.nycrc @@ -0,0 +1,17 @@ +{ + "lines": 90, + "functions": 55, + "branches": 66, + "statements": 91, + "reporter": [ + "html", + "text-summary" + ], + "require": [ + "babel-register" + ], + "exclude": [ + "test" + ], + "check-coverage": true + } diff --git a/package.json b/package.json index 8087038..67d0fa2 100644 --- a/package.json +++ b/package.json @@ -5,13 +5,13 @@ "main": "lib/index.js", "scripts": { "prepublish": "not-in-publish || safe-publish-latest && npm run build", - "build": "rimraf lib && babel src -d lib", + "build": "rimraf lib && babel --source-maps inline src -d lib", "lint": "eslint src test", "pretest": "npm run --silent lint", "test": "npm run build && npm run test:coverage && npm run --silent cover:check", "tests-only": "npm run build && npm run test:quick", - "test:coverage": "babel-node node_modules/.bin/istanbul cover --report html node_modules/.bin/_mocha -- -R tap test/init.js test/*-test.js", - "cover:check": "istanbul check-coverage && echo code coverage thresholds met, achievement unlocked!", + "test:coverage": "nyc --silent node_modules/.bin/mocha -R tap test/init.js test/*-test.js", + "cover:check": "nyc report && echo code coverage thresholds met, achievement unlocked!", "test:quick": "babel-node node_modules/.bin/_mocha -R tap test/init.js test/*-test.js" }, "repository": { @@ -50,11 +50,11 @@ "eslint-config-airbnb-base": "^11.2.0", "eslint-plugin-import": "^2.2.0", "in-publish": "^2.0.0", - "istanbul": "^1.0.0-alpha.2", "mocha": "^3.4.1", "mocha-wrap": "^2.1.1", "rimraf": "^2.6.1", "safe-publish-latest": "^1.1.1", + "nyc": "^10.3.2", "sinon": "^1.17.7", "sinon-sandbox": "^1.0.2" },