diff --git a/.travis.yml b/.travis.yml index cd312691a2..a4f644190a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,6 +32,13 @@ before_install: - | # Remove example dependencies npm rm --silent --save-dev connect-redis + # Setup Node.js version-specific dependencies + - | + # mocha for testing + # - use 3.x for Node.js < 6 + if [[ "$(cut -d. -f1 <<< "$TRAVIS_NODE_VERSION")" -lt 6 ]]; then + npm install --silent --save-dev mocha@3.5.3 + fi # Update Node.js modules - | # Prune and rebuild node_modules diff --git a/appveyor.yml b/appveyor.yml index fd5dcea0a6..bb954116f1 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -25,6 +25,13 @@ install: - ps: | # Remove example dependencies npm rm --silent --save-dev connect-redis + # Setup Node.js version-specific dependencies + - ps: | + # mocha for testing + # - use 3.x for Node.js < 6 + if ($env:nodejs_version.split(".")[0] -lt 6) { + npm install --silent --save-dev mocha@3.5.3 + } # Update Node.js modules - ps: | # Prune & rebuild node_modules diff --git a/package.json b/package.json index 45faac1c6b..bbd79fbf88 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,7 @@ "istanbul": "0.4.5", "marked": "0.5.0", "method-override": "3.0.0", - "mocha": "3.5.3", + "mocha": "5.2.0", "morgan": "1.9.1", "multiparty": "4.2.1", "pbkdf2-password": "1.2.1", @@ -90,9 +90,9 @@ ], "scripts": { "lint": "eslint .", - "test": "mocha --require test/support/env --reporter spec --bail --check-leaks --no-exit test/ test/acceptance/", - "test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --require test/support/env --reporter spec --check-leaks --no-exit test/ test/acceptance/", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --require test/support/env --reporter dot --check-leaks --no-exit test/ test/acceptance/", - "test-tap": "mocha --require test/support/env --reporter tap --check-leaks --no-exit test/ test/acceptance/" + "test": "mocha --require test/support/env --reporter spec --bail --check-leaks test/ test/acceptance/", + "test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --require test/support/env --reporter spec --check-leaks test/ test/acceptance/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --require test/support/env --reporter dot --check-leaks test/ test/acceptance/", + "test-tap": "mocha --require test/support/env --reporter tap --check-leaks test/ test/acceptance/" } } diff --git a/test/mocha.opts b/test/mocha.opts index 24d45f5902..1e065ec52d 100644 --- a/test/mocha.opts +++ b/test/mocha.opts @@ -1,3 +1,2 @@ --require should --slow 20 ---growl