Skip to content

Commit fd7ddcd

Browse files
committed
[Tests] add nyc coverage
1 parent 9802fb3 commit fd7ddcd

File tree

4 files changed

+23
-5
lines changed

4 files changed

+23
-5
lines changed

.github/workflows/nodejs.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ jobs:
5757
NPM_CONFIG_STRICT_SSL: false
5858
if: matrix.os == 'windows-latest'
5959

60-
- run: npm run tests-only
60+
- run: ./node_modules/.bin/tape 'test/**/*.js'
6161
- uses: codecov/codecov-action@v3
62-
62+
6363
nonlatest:
6464
needs: [matrix, latest]
6565
name: 'non-latest majors'
@@ -97,12 +97,12 @@ jobs:
9797
NPM_CONFIG_STRICT_SSL: false
9898
if: matrix.os == 'windows-latest'
9999

100-
- run: npm run tests-only
100+
- run: ./node_modules/.bin/tape 'test/**/*.js'
101101
- uses: codecov/codecov-action@v3
102102

103103
node:
104104
name: 'node majors, windows/mac'
105105
needs: [latest, nonlatest]
106106
runs-on: ubuntu-latest
107107
steps:
108-
- run: 'echo tests completed'
108+
- run: 'echo tests completed'

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
node_modules
44

5+
coverage/
6+
.nyc_output/
7+
58
# Only apps should have lockfiles
69
npm-shrinkwrap.json
710
package-lock.json

.nycrc

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"all": true,
3+
"check-coverage": false,
4+
"reporter": ["text-summary", "text", "html", "json"],
5+
"lines": 86,
6+
"statements": 85.93,
7+
"functions": 82.43,
8+
"branches": 76.06,
9+
"exclude": [
10+
"coverage",
11+
"example",
12+
"test"
13+
]
14+
}

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"evalmd": "^0.0.19",
2020
"in-publish": "^2.0.1",
2121
"npmignore": "^0.3.0",
22+
"nyc": "^10.3.2",
2223
"safe-publish-latest": "^2.0.0",
2324
"tape": "^5.6.3"
2425
},
@@ -42,7 +43,7 @@
4243
"prelint": "evalmd README.md",
4344
"lint": "eslint --ext=js,mjs .",
4445
"pretest": "npm run lint",
45-
"tests-only": "tape 'test/**/*.js'",
46+
"tests-only": "nyc tape 'test/**/*.js'",
4647
"test": "npm run tests-only",
4748
"posttest": "aud --production",
4849
"version": "auto-changelog && git add CHANGELOG.md",

0 commit comments

Comments
 (0)