diff --git a/.travis.yml b/.travis.yml index 62a84395..72c3b4cd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,6 +37,18 @@ before_install: grep -E '^eslint(-|$)' | \ xargs npm rm --save-dev fi + - | + # mocha for testing + # - use 1.x for Node.js < 0.8 + # - use 2.x for Node.js < 0.10 + # - use 3.x for Node.js < 4 + if [[ "$(cut -d. -f1 <<< "$TRAVIS_NODE_VERSION")" -eq 0 && "$(cut -d. -f2 <<< "$TRAVIS_NODE_VERSION")" -lt 8 ]]; then + npm install --save-dev mocha@1.21.5 + elif [[ "$(cut -d. -f1 <<< "$TRAVIS_NODE_VERSION")" -eq 0 && "$(cut -d. -f2 <<< "$TRAVIS_NODE_VERSION")" -lt 10 ]]; then + npm install --save-dev mocha@2.5.3 + elif [[ "$(cut -d. -f1 <<< "$TRAVIS_NODE_VERSION")" -lt 4 ]]; then + npm install --save-dev mocha@3.5.3 + fi # Update Node.js modules - | # Prune and rebuild node_modules diff --git a/package.json b/package.json index 0e38083a..f3cf6fdd 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "eslint-plugin-promise": "4.0.1", "eslint-plugin-standard": "4.0.0", "istanbul": "0.4.5", - "mocha": "2.5.3", + "mocha": "5.2.0", "supertest": "1.1.0" }, "files": [ @@ -40,8 +40,8 @@ }, "scripts": { "lint": "eslint --plugin markdown --ext js,md .", - "test": "mocha --check-leaks --reporter spec --bail --no-exit", + "test": "mocha --check-leaks --reporter spec --bail", "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --check-leaks --reporter dot", - "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --check-leaks --reporter spec --no-exit" + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --check-leaks --reporter spec" } }