forked from expressjs/generator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
11 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,21 @@ | ||
language: node_js | ||
node_js: | ||
- "0.10" | ||
- "0.12" | ||
- "1.8" | ||
- "2.5" | ||
- "3.3" | ||
- "4.9" | ||
- "5.12" | ||
- "6.16" | ||
- "7.10" | ||
- "8.15" | ||
- "9.11" | ||
- 10 | ||
- 11 | ||
- 12 | ||
- 13 | ||
matrix: | ||
fast_finish: true | ||
sudo: false | ||
cache: | ||
directories: | ||
- node_modules | ||
before_install: | ||
# Configure npm | ||
- | | ||
# Skip updating shrinkwrap / lock | ||
npm config set shrinkwrap false | ||
# Setup Node.js version-specific dependencies | ||
- | | ||
# eslint for linting | ||
# - remove on Node.js < 6 | ||
if [[ "$(cut -d. -f1 <<< "$TRAVIS_NODE_VERSION")" -lt 6 ]]; then | ||
node -pe 'Object.keys(require("./package").devDependencies).join("\n")' | \ | ||
grep -E '^eslint(-|$)' | \ | ||
xargs npm rm --save-dev | ||
fi | ||
- | | ||
# mocha for testing | ||
# - use 3.x for Node.js < 4 | ||
# - use 5.x for Node.js < 6 | ||
if [[ "$(cut -d. -f1 <<< "$TRAVIS_NODE_VERSION")" -lt 4 ]]; then | ||
npm install --save-dev mocha@3.5.3 | ||
elif [[ "$(cut -d. -f1 <<< "$TRAVIS_NODE_VERSION")" -lt 6 ]]; then | ||
npm install --save-dev mocha@5.2.0 | ||
fi | ||
- | | ||
# supertest for http calls | ||
# - use 2.0.0 for Node.js < 4 | ||
# - use 3.4.2 for Node.js < 6 | ||
if [[ "$(cut -d. -f1 <<< "$TRAVIS_NODE_VERSION")" -lt 4 ]]; then | ||
npm install --save-dev supertest@2.0.0 | ||
elif [[ "$(cut -d. -f1 <<< "$TRAVIS_NODE_VERSION")" -lt 6 ]]; then | ||
npm install --save-dev supertest@3.4.2 | ||
fi | ||
# Update Node.js modules | ||
- | | ||
# Prune and rebuild node_modules | ||
if [[ -d node_modules ]]; then | ||
npm prune | ||
npm rebuild | ||
fi | ||
script: | ||
# Run test script | ||
- npm run test-ci | ||
# Run linting | ||
- | | ||
# Run linting, depending on eslint install | ||
if [[ -n "$(npm -ps ls eslint)" ]]; then | ||
npm run-script lint | ||
fi | ||
- npm run lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters