From 946727bf321a365a807036b909da810d95c5bbd8 Mon Sep 17 00:00:00 2001 From: Douglas Christopher Wilson Date: Sun, 28 Oct 2018 10:43:02 -0400 Subject: [PATCH] build: install nyc on demand --- .travis.yml | 10 ++++------ appveyor.yml | 2 +- package.json | 5 ++--- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 53c49c826..03e9497bf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -56,8 +56,7 @@ before_install: - "npm config set shrinkwrap false" # Setup Node.js version-specific dependencies - - "test $TRAVIS_NODE_VERSION != '0.6' || npm rm --save-dev nyc" - - "test $TRAVIS_NODE_VERSION != '0.8' || npm rm --save-dev nyc" + - "node tool/install-nyc.js --nyc-optional" - "test $(echo $TRAVIS_NODE_VERSION | cut -d. -f1) -ge 4 || npm rm --save-dev eslint" # Update Node.js modules @@ -78,10 +77,9 @@ before_script: - "docker exec mysql mysql -e 'select version()'" script: - # Run test script, depending on nyc install - - "test ! -z $(npm -ps ls nyc) || npm test" - - "test -z $(npm -ps ls nyc) || npm run-script test-ci" - - "test -z $(npm -ps ls eslint) || npm run-script lint" + # Run test script + - "npm run-script test-ci" + - "test -z $(npm -ps ls eslint) || npm run-script lint" after_script: - "test -d .nyc_output && npm install coveralls@2 && nyc report --reporter=text-lcov | coveralls" diff --git a/appveyor.yml b/appveyor.yml index a5ee28962..ca0a86a27 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -32,7 +32,7 @@ install: catch { Update-NodeJsInstallation (Get-NodeJsLatestBuild $env:nodejs_version) } - npm config set shrinkwrap false - if "%nodejs_version%" equ "0.8" npm config set strict-ssl false - - npm rm --silent --save-dev eslint nyc + - npm rm --silent --save-dev eslint - if exist node_modules npm prune - if exist node_modules npm rebuild - npm install diff --git a/package.json b/package.json index e71b58bb6..a577429a8 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,6 @@ "devDependencies": { "after": "0.8.2", "eslint": "4.19.1", - "nyc": "10.3.2", "seedrandom": "2.4.4", "timezone-mock": "0.0.7", "urun": "0.0.8", @@ -40,8 +39,8 @@ "scripts": { "lint": "eslint .", "test": "node test/run.js", - "test-ci": "nyc --reporter=text npm test", - "test-cov": "nyc --reporter=html --reporter=text npm test", + "test-ci": "node tool/install-nyc.js --nyc-optional --reporter=text -- npm test", + "test-cov": "node tool/install-nyc.js --reporter=html --reporter=text -- npm test", "version": "node tool/version-changes.js && git add Changes.md" } }