Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
dougwilson committed Dec 23, 2018
1 parent 3f1c388 commit 8b9a806
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ before_install:
fs.writeFileSync("package.json", JSON.stringify(p, null, 2) + "\n");
' "$@"
}
function npm_use_module () {
node -e '
fs = require("fs");
p = JSON.parse(fs.readFileSync("package.json", "utf8"));
p.devDependencies[process.argv[1]] = process.argv[2];
fs.writeFileSync("package.json", JSON.stringify(p, null, 2) + "\n");
' "$@"
}
function v () {
tr '.' '\n' <<< "${1}" \
| awk '{ printf "%03d", $0 }' \
Expand All @@ -60,6 +68,11 @@ before_install:
# Configure istanbul for coverage
if node_version_lt '0.10'; then npm_remove_module_re '^istanbul$'
fi
- |
# Configure mocha for testing
if node_version_lt '0.10'; then npm_use_module 'mocha' '2.5.3'
elif node_version_lt '4.0' ; then npm_use_module 'mocha' '3.5.3'
fi
# Update Node.js modules
- |
# Prune & rebuild node_modules
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"eslint-plugin-standard": "4.0.0",
"istanbul": "0.4.5",
"methods": "1.1.2",
"mocha": "2.5.3",
"mocha": "5.2.0",
"safe-buffer": "5.1.2",
"supertest": "1.1.0"
},
Expand Down

0 comments on commit 8b9a806

Please sign in to comment.