Skip to content

Commit

Permalink
build: mocha@6.2.0
Browse files Browse the repository at this point in the history
closes #180
  • Loading branch information
dougwilson committed Sep 27, 2019
1 parent 9e75303 commit c933e32
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 1 deletion.
13 changes: 13 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,19 @@ before_install:
if [[ "$(cut -d. -f1 <<< "$TRAVIS_NODE_VERSION")" -lt 6 ]]; then
npm rm --slient --save-dev eslint
fi
- |
# mocha for testing
# - use 2.x for Node.js < 0.10
# - use 3.x for Node.js < 4
# - use 5.x for Node.js < 6
if [[ "$(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
elif [[ "$(cut -d. -f1 <<< "$TRAVIS_NODE_VERSION")" -lt 6 ]]; then
npm install --save-dev mocha@5.2.0
fi
- |
# nyc for coverage
# - remove for Node.js < 6
if [[ "$(cut -d. -f1 <<< "$TRAVIS_NODE_VERSION")" -lt 6 ]]; then
Expand Down
13 changes: 13 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,19 @@ install:
- npm config set shrinkwrap false
# Remove all non-test dependencies
- npm rm --silent --save-dev eslint nyc
# Setup Node.js version-specific dependencies
- ps: |
# mocha for testing
# - use 2.x for Node.js < 0.10
# - use 3.x for Node.js < 4
# - use 5.x for Node.js < 6
if ([int]$env:nodejs_version.split(".")[0] -eq 0 -and [int]$env:nodejs_version.split(".")[1] -lt 10) {
npm install --silent --save-dev mocha@2.5.3
} elseif ([int]$env:nodejs_version.split(".")[0] -lt 4) {
npm install --silent --save-dev mocha@3.5.3
} elseif ([int]$env:nodejs_version.split(".")[0] -lt 6) {
npm install --silent --save-dev mocha@5.2.0
}
# Install Node.js modules
- npm install
build: off
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"devDependencies": {
"eslint": "5.16.0",
"mocha": "2.5.3",
"mocha": "6.2.0",
"nyc": "14.1.1",
"rimraf": "2.7.1",
"supertest": "1.1.0"
Expand Down
6 changes: 6 additions & 0 deletions test/3.x/app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
var path = require('path')
var request = require('supertest')
var utils = require('../support/utils')

var FIXTURES_DIR = path.join(__dirname, '..', 'fixtures')

Expand Down Expand Up @@ -32,6 +33,11 @@ hbs.registerPartials(__dirname + '/views/partials');
var app = null

before(function () {
if (utils.nodeVersionCompare(10.0) >= 0) {
this.skip()
return
}

var express = require('express')

app = express()
Expand Down
6 changes: 6 additions & 0 deletions test/4.x/app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
var path = require('path')
var request = require('supertest')
var utils = require('../support/utils')

var FIXTURES_DIR = path.join(__dirname, '..', 'fixtures')

Expand Down Expand Up @@ -32,6 +33,11 @@ hbs.registerPartials(__dirname + '/views/partials');
var app = null

before(function () {
if (utils.nodeVersionCompare(0.10) <= 0) {
this.skip()
return
}

var express = require('express')

app = express()
Expand Down

0 comments on commit c933e32

Please sign in to comment.