Skip to content

Commit

Permalink
[Tests] up to node v8; newer npm breaks on older node; fix scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Aug 26, 2017
1 parent 8cc6251 commit dbafd2c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 56 deletions.
69 changes: 16 additions & 53 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,20 @@
language: node_js
os:
- linux
node_js:
- "6.6"
- "6.5"
- "6.4"
- "6.3"
- "6.2"
- "6.1"
- "6.0"
- "5.12"
- "5.11"
- "5.10"
- "5.9"
- "5.8"
- "5.7"
- "5.6"
- "5.5"
- "5.4"
- "5.3"
- "5.2"
- "5.1"
- "5.0"
- "4.5"
- "4.4"
- "4.3"
- "4.2"
- "4.1"
- "4.0"
- "8"
- "7"
- "6"
- "5"
- "4"
before_install:
- 'if [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then case "$(npm --version)" in 1.*) npm install -g [email protected] ;; 2.*) npm install -g npm@2 ;; esac ; fi'
- 'if [ "${TRAVIS_NODE_VERSION}" != "0.6" ] && [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then npm install -g npm; fi'
- 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ]; then npm install -g [email protected] ; elif [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then case "$(npm --version)" in 1.*) npm install -g [email protected] ;; 2.*) npm install -g npm@2 ;; esac ; fi'
- 'if [ "${TRAVIS_NODE_VERSION}" != "0.6" ] && [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then if [ "${TRAVIS_NODE_VERSION%${TRAVIS_NODE_VERSION#[0-9]}}" = "0" ] || [ "${TRAVIS_NODE_VERSION:0:4}" = "iojs" ]; then npm install -g [email protected] ; else npm install -g npm; fi; fi'
install:
- 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ]; then nvm install 0.8 && npm install -g [email protected] && npm install -g [email protected] && npm install -g npm@2 && npm install && nvm use "${TRAVIS_NODE_VERSION}"; else npm install; fi;'
script:
- 'if [ -n "${LINT-}" ]; then npm run lint ; fi'
- 'if [ -n "${PRETEST-}" ]; then npm run pretest ; fi'
- 'if [ -n "${POSTTEST-}" ]; then npm run posttest ; fi'
- 'if [ -n "${COVERAGE-}" ]; then npm run coverage ; fi'
- 'if [ -n "${TEST-}" ]; then npm run tests-only ; fi'
sudo: false
Expand All @@ -40,30 +24,9 @@ matrix:
fast_finish: true
include:
- node_js: "node"
env: LINT=true
env: PRETEST=true
- node_js: "4"
env: COVERAGE=true
allow_failures:
- node_js: "6.5"
- node_js: "6.4"
- node_js: "6.3"
- node_js: "6.2"
- node_js: "6.1"
- node_js: "6.0"
- node_js: "5.11"
- node_js: "5.10"
- node_js: "5.9"
- node_js: "5.8"
- node_js: "5.7"
- node_js: "5.6"
- node_js: "5.5"
- node_js: "5.4"
- node_js: "5.3"
- node_js: "5.2"
- node_js: "5.1"
- node_js: "5.0"
- node_js: "4.4"
- node_js: "4.3"
- node_js: "4.2"
- node_js: "4.1"
- node_js: "4.0"
- os: osx
- env: TEST=true ALLOW_FAILURE=true
11 changes: 8 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,16 @@
"main": "lib/index.js",
"scripts": {
"prepublish": "npm run build",
"build": "rimraf lib && babel src -d lib",
"clean": "rimraf lib coverage",
"prebuild": "npm run clean",
"build": "babel src -d lib",
"lint": "eslint src test",
"test": "npm run lint && npm run build && npm run coverage",
"tests-only": "npm run build && npm run test:quick",
"pretest": "npm run lint",
"test": "npm run coverage",
"tests-only": "npm run test:quick",
"precoverage": "npm run build",
"coverage": "babel-node node_modules/.bin/istanbul cover --report=html node_modules/.bin/_mocha -- -R tap test/*-test.js",
"pretest:quick": "npm run build",
"test:quick": "babel-node node_modules/.bin/_mocha -R tap test/*-test.js"
},
"repository": {
Expand Down

0 comments on commit dbafd2c

Please sign in to comment.