From a625a243d096d1987ecb7147b055190cce7797dc Mon Sep 17 00:00:00 2001 From: Jimmy King Date: Fri, 8 Nov 2019 09:29:59 -0700 Subject: [PATCH] test(coverage): switch to nyc for coverage from both tests --- .gitignore | 1 + index.js | 1 + package.json | 8 +++++--- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 123ae94..eebf6ac 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ lib-cov # Coverage directory used by tools like istanbul coverage +.nyc_output # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) .grunt diff --git a/index.js b/index.js index 987ca0c..c7b80b1 100644 --- a/index.js +++ b/index.js @@ -205,6 +205,7 @@ function invalidExtras(data, msg) { function recordName(record) { /* eslint no-underscore-dangle: 0 */ + /* istanbul ignore next */ return record._name || record.constructor.name || 'Record'; } diff --git a/package.json b/package.json index a7887d9..c23712d 100644 --- a/package.json +++ b/package.json @@ -4,9 +4,11 @@ "description": "Transit serialisation for Immutable.js", "main": "index.js", "scripts": { - "test": "npm install --no-save immutable@3 && mocha && npm install --no-save immutable@^4.0.0-rc.12 && mocha", + "test:3": "npm install --no-save immutable@^3.7.4 && mocha", + "test:4": "npm install --no-save immutable@^4.0.0-rc.12 && mocha", + "test": "npm run test:3 && npm run test:4", "lint": "eslint .", - "coverage": "istanbul cover _mocha --" + "coverage": "nyc npm test && nyc report --reporter=lcov --reporter=json" }, "repository": { "type": "git", @@ -28,8 +30,8 @@ "coveralls": "^2.11.2", "eslint": "^0.24.1", "immutable": ">=3.7.4", - "istanbul": "^0.3.14", "mocha": "^2.2.5", + "nyc": "^14.1.1", "transit-js": "^0.8.807" } }