Skip to content

Commit

Permalink
[Tests] add nyc coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Jan 30, 2023
1 parent 9802fb3 commit fd7ddcd
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 5 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ jobs:
NPM_CONFIG_STRICT_SSL: false
if: matrix.os == 'windows-latest'

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

nonlatest:
needs: [matrix, latest]
name: 'non-latest majors'
Expand Down Expand Up @@ -97,12 +97,12 @@ jobs:
NPM_CONFIG_STRICT_SSL: false
if: matrix.os == 'windows-latest'

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

node:
name: 'node majors, windows/mac'
needs: [latest, nonlatest]
runs-on: ubuntu-latest
steps:
- run: 'echo tests completed'
- run: 'echo tests completed'
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

node_modules

coverage/
.nyc_output/

# Only apps should have lockfiles
npm-shrinkwrap.json
package-lock.json
Expand Down
14 changes: 14 additions & 0 deletions .nycrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"all": true,
"check-coverage": false,
"reporter": ["text-summary", "text", "html", "json"],
"lines": 86,
"statements": 85.93,
"functions": 82.43,
"branches": 76.06,
"exclude": [
"coverage",
"example",
"test"
]
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"evalmd": "^0.0.19",
"in-publish": "^2.0.1",
"npmignore": "^0.3.0",
"nyc": "^10.3.2",
"safe-publish-latest": "^2.0.0",
"tape": "^5.6.3"
},
Expand All @@ -42,7 +43,7 @@
"prelint": "evalmd README.md",
"lint": "eslint --ext=js,mjs .",
"pretest": "npm run lint",
"tests-only": "tape 'test/**/*.js'",
"tests-only": "nyc tape 'test/**/*.js'",
"test": "npm run tests-only",
"posttest": "aud --production",
"version": "auto-changelog && git add CHANGELOG.md",
Expand Down

0 comments on commit fd7ddcd

Please sign in to comment.