From 820c99aeba7f35b68de89ce915660e8248daa928 Mon Sep 17 00:00:00 2001 From: "St. John Johnson" Date: Sat, 29 Jun 2019 17:08:30 -0700 Subject: [PATCH] [major] Bump NYC to latest version Pass `--cache=false` to prevent unknown coverage. Resolves #38 --- lib/jenkins.js | 1 + package.json | 2 +- test/jenkins.test.js | 8 ++++---- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/jenkins.js b/lib/jenkins.js index a4abbe8..7f0cfa1 100644 --- a/lib/jenkins.js +++ b/lib/jenkins.js @@ -73,6 +73,7 @@ module.exports = function (args) { command.push('--reporter lcov --reporter text-summary'); } + command.push('--cache=false'); command.push('--report-dir ' + escape(directories.coverage) + ' --'); command.push('node', nodeArgs, getBin('_mocha')); } else { diff --git a/package.json b/package.json index 0ad47df..2cbdbc9 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "dependencies": { "mocha": "^6.0.0", "npm-which": "^3.0.0", - "nyc": "^12.0.0", + "nyc": "^14.0.0", "shell-escape": "^0.2.0", "shelljs": "^0.8.3", "spec-xunit-file": "0.0.1-3" diff --git a/test/jenkins.test.js b/test/jenkins.test.js index b0c0ec6..8e0d483 100644 --- a/test/jenkins.test.js +++ b/test/jenkins.test.js @@ -79,7 +79,7 @@ describe('Jenkins Mocha Test Case', function () { // Check exec A.equalObject(mocks.exec.args[0], [ - 'node ' + nycPath + ' --reporter lcov --reporter text-summary --report-dir ' + + 'node ' + nycPath + ' --reporter lcov --reporter text-summary --cache=false --report-dir ' + coverage + ' -- node ' + _mochaPath + ' --reporter ' + specXunitPath + ' --colors --foo \'tests/*\'' ], 'mocha was called correctly'); @@ -102,7 +102,7 @@ describe('Jenkins Mocha Test Case', function () { // Check exec A.equalObject(mocks.exec.args[0], [ - 'node ' + nycPath + ' --reporter lcov --reporter text-summary --report-dir ' + + 'node ' + nycPath + ' --reporter lcov --reporter text-summary --cache=false --report-dir ' + coverage + ' -- node ' + _mochaPath + ' --reporter ' + specXunitPath + ' --foo \'tests/*\' --no-colors' ], 'mocha was called correctly'); @@ -146,7 +146,7 @@ describe('Jenkins Mocha Test Case', function () { // Check exec A.equalObject(mocks.exec.args[0], [ - 'node ' + nycPath + ' --reporter cobertura --report-dir ' + + 'node ' + nycPath + ' --reporter cobertura --cache=false --report-dir ' + coverage + ' -- node ' + _mochaPath + ' --reporter ' + specXunitPath + ' --colors --foo \'tests/*\'' ], 'mocha was called correctly'); @@ -171,7 +171,7 @@ describe('Jenkins Mocha Test Case', function () { // Check exec A.equalObject(mocks.exec.args[0], [ - 'node --flop=blop ' + nycPath + ' --reporter lcov --reporter text-summary --report-dir ' + + 'node --flop=blop ' + nycPath + ' --reporter lcov --reporter text-summary --cache=false --report-dir ' + coverage + ' -- node --flop=blop ' + _mochaPath + ' --reporter ' + specXunitPath + ' --foo \'tests/*\' --no-colors' ], 'mocha was called correctly');