Skip to content

Commit

Permalink
build: install nyc on demand
Browse files Browse the repository at this point in the history
  • Loading branch information
dougwilson committed Oct 28, 2018
1 parent 0420029 commit 946727b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
10 changes: 4 additions & 6 deletions .travis.yml
Expand Up @@ -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
Expand All @@ -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"
2 changes: 1 addition & 1 deletion appveyor.yml
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions package.json
Expand Up @@ -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",
Expand All @@ -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"
}
}

0 comments on commit 946727b

Please sign in to comment.