Skip to content

Commit

Permalink
ci: don't lint on older node; do preserve failed test
Browse files Browse the repository at this point in the history
  • Loading branch information
Artoria2e5 committed Oct 19, 2019
1 parent 595bae0 commit ba01435
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
10 changes: 10 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,13 @@ node_js:
- 8
- 6
- 4

script:
# Avoid linting on older node
- |
nodever=$(node --version | cut -d. -f1)
if [[ $nodever == v12 ]]; then
npm run test
else
node ./bin/cli.js
fi
7 changes: 4 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
environment:
matrix:
- nodejs_version: ''
- nodejs_version: 7
- nodejs_version: 6
- nodejs_version: 4

install:
- ps: Install-Product node $env:nodejs_version
- ps: if ($env:nodejs_version -like '') { Install-Product node $env:nodejs_version }
- npm i -g npm@3
- npm install
- set CI=true

test_script:
- node --version
- npm --version
- npm run lint
- "node lib\\cli.js || ver > null"
- ps: if ($env:nodejs_version -like '') { npm run lint }
- "node bin/cli.js || ver > null"
- "echo Exit code: %errorlevel%"

build: off
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"scripts": {
"lint": "xo ./lib/**/*.js",
"lint:fix": "xo ./lib/**/*.js --fix",
"test": "npm run lint && ./bin/cli.js || echo Exit Status: $?.",
"test": "npm run lint && ./bin/cli.js || { ev=$?; echo \"Exit status: $ev\">&2; exit $ev }",
"transpile": "babel lib --out-dir lib-es5",
"watch": "babel lib --out-dir lib-es5 --watch",
"prepare": "npm run transpile"
Expand Down

0 comments on commit ba01435

Please sign in to comment.