Skip to content

Commit

Permalink
build: use nyc for test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
dougwilson committed Feb 8, 2022
1 parent 884657d commit 12310c5
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 12 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,39 +31,39 @@ jobs:
include:
- name: Node.js 0.10
node-version: "0.10"
npm-i: minimatch@3.0.4 mocha@3.5.3 supertest@2.0.0
npm-i: minimatch@3.0.4 mocha@3.5.3 nyc@10.3.2 supertest@2.0.0

- name: Node.js 0.12
node-version: "0.12"
npm-i: minimatch@3.0.4 mocha@3.5.3 supertest@2.0.0
npm-i: minimatch@3.0.4 mocha@3.5.3 nyc@10.3.2 supertest@2.0.0

- name: io.js 1.x
node-version: "1.8"
npm-i: minimatch@3.0.4 mocha@3.5.3 supertest@2.0.0
npm-i: minimatch@3.0.4 mocha@3.5.3 nyc@10.3.2 supertest@2.0.0

- name: io.js 2.x
node-version: "2.5"
npm-i: minimatch@3.0.4 mocha@3.5.3 supertest@2.0.0
npm-i: minimatch@3.0.4 mocha@3.5.3 nyc@10.3.2 supertest@2.0.0

- name: io.js 3.x
node-version: "3.3"
npm-i: minimatch@3.0.4 mocha@3.5.3 supertest@2.0.0
npm-i: minimatch@3.0.4 mocha@3.5.3 nyc@10.3.2 supertest@2.0.0

- name: Node.js 4.x
node-version: "4.9"
npm-i: mocha@5.2.0 supertest@3.4.2
npm-i: mocha@5.2.0 nyc@11.9.0 supertest@3.4.2

- name: Node.js 5.x
node-version: "5.12"
npm-i: mocha@5.2.0 supertest@3.4.2
npm-i: mocha@5.2.0 nyc@11.9.0 supertest@3.4.2

- name: Node.js 6.x
node-version: "6.17"
npm-i: mocha@6.2.2 supertest@6.1.6
npm-i: mocha@6.2.2 nyc@14.1.1 supertest@6.1.6

- name: Node.js 7.x
node-version: "7.10"
npm-i: mocha@6.2.2 supertest@6.1.6
npm-i: mocha@6.2.2 nyc@14.1.1 supertest@6.1.6

- name: Node.js 8.x
node-version: "8.17"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package-lock.json
*.gz

# Coveralls
.nyc_output
coverage

# Benchmarking
Expand Down
12 changes: 12 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,18 @@ install:
} elseif ([int]$env:nodejs_version.split(".")[0] -lt 12) {
npm install --silent --save-dev mocha@8.4.0
}
- ps: |
# nyc for test coverage
# - use 10.3.2 for Node.js < 4
# - use 11.9.0 for Node.js < 6
# - use 14.1.1 for Node.js < 8
if ([int]$env:nodejs_version.split(".")[0] -lt 4) {
npm install --silent --save-dev nyc@10.3.2
} elseif ([int]$env:nodejs_version.split(".")[0] -lt 6) {
npm install --silent --save-dev nyc@11.9.0
} elseif ([int]$env:nodejs_version.split(".")[0] -lt 8) {
npm install --silent --save-dev nyc@14.1.1
}
- ps: |
# supertest for http calls
# - use 2.0.0 for Node.js < 4
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@
"eslint": "7.32.0",
"express-session": "1.17.2",
"hbs": "4.2.0",
"istanbul": "0.4.5",
"marked": "0.7.0",
"method-override": "3.0.0",
"mocha": "9.2.0",
"morgan": "1.10.0",
"multiparty": "4.2.2",
"nyc": "15.1.0",
"pbkdf2-password": "1.2.1",
"should": "13.2.3",
"supertest": "6.2.2",
Expand All @@ -92,8 +92,8 @@
"scripts": {
"lint": "eslint .",
"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-ci": "nyc --reporter=lcovonly --reporter=text npm test",
"test-cov": "nyc --reporter=html --reporter=text npm test",
"test-tap": "mocha --require test/support/env --reporter tap --check-leaks test/ test/acceptance/"
}
}

0 comments on commit 12310c5

Please # to comment.