Skip to content

Commit

Permalink
[Tests] only run the linter once, not on every build
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Jan 26, 2020
1 parent 26f232b commit 2d42464
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Expand Up @@ -19,6 +19,8 @@ env:
# osx backlog is often deep, so to be polite we can just hit these highlights
matrix:
include:
- env: LINT=true
node_js: lts/*
- env: PACKAGE=resolvers/node
node_js: 13
- env: PACKAGE=resolvers/node
Expand Down Expand Up @@ -81,7 +83,7 @@ install:
- 'if [ -n "${ESLINT_VERSION}" ]; then ./tests/dep-time-travel.sh; fi'

script:
- 'npm test'
- 'if [ -n "${LINT-}" ]; then npm run posttest ; else npm run tests-only ; fi'

after_success:
- npm run coveralls
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -23,7 +23,8 @@
"pretest": "linklocal",
"posttest": "eslint .",
"mocha": "cross-env BABEL_ENV=test NODE_PATH=./src nyc -s mocha -R dot --recursive -t 5s",
"test": "npm run mocha tests/src",
"tests-only": "npm run mocha tests/src",
"test": "npm run tests-only",
"test-compiled": "npm run prepublish && NODE_PATH=./lib mocha --compilers js:babel-register --recursive tests/src",
"test-all": "npm test && for resolver in ./resolvers/*; do cd $resolver && npm test && cd ../..; done",
"prepublish": "npm run build",
Expand Down
3 changes: 2 additions & 1 deletion resolvers/node/package.json
Expand Up @@ -8,7 +8,8 @@
],
"scripts": {
"prepublishOnly": "cp ../../{LICENSE,.npmrc} ./",
"test": "nyc mocha",
"tests-only": "nyc mocha",
"test": "npm run tests-only",
"coveralls": "nyc report --reporter lcovonly && cd ../.. && coveralls < ./resolvers/node/coverage/lcov.info"
},
"repository": {
Expand Down
3 changes: 2 additions & 1 deletion resolvers/webpack/package.json
Expand Up @@ -5,7 +5,8 @@
"main": "index.js",
"scripts": {
"prepublishOnly": "cp ../../{LICENSE,.npmrc} ./",
"test": "nyc mocha -t 5s",
"tests-only": "nyc mocha -t 5s",
"test": "npm run tests-only",
"report": "nyc report --reporter=html",
"coveralls": "nyc report --reporter lcovonly && cd ../.. && coveralls < ./resolvers/webpack/coverage/lcov.info"
},
Expand Down

0 comments on commit 2d42464

Please sign in to comment.