Skip to content

Commit 5243401

Browse files
committed
Migrate tests from mocha and chai to node-tap (#83)
* Replace testing dependencies - `mocha` with `tap` - `chai-http` with `simple-get` * Rewrite Validator tests to use tap The original tests were testing Ajv functionality, which seems unnecessary, so I've removed them. * Rewrite middleware tests to use tap * Rewrite integration tests to use tap In the process of rewriting these tests I've added `name` as a required property in the JSON schema and corrected the request body which is being sent for a "valid" request. * Remove glob from tap command in test run script The `tap` CLI will automatically look in the `test/` directory. * Update CI GitHub Actions workflow Change to work with `tap`. * Update npm lockfile * Update ESLint configuration The `no-shadow` rule has been disabled for tests, as when tests are written using `tap`, the variable `t` is typically shadowed in subtests.
1 parent 5424157 commit 5243401

File tree

11 files changed

+2421
-685
lines changed

11 files changed

+2421
-685
lines changed

.eslintrc.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
{
22
"env": {
33
"es6": true,
4-
"node": true,
5-
"mocha": true
4+
"node": true
65
},
76
"extends": [
87
"google",

.github/workflows/ci.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,5 @@ jobs:
2424
with:
2525
node-version: ${{ matrix.node-version }}
2626
- run: npm ci
27-
- run: npx nyc mocha
28-
- run: npx nyc report --reporter=lcov
29-
- run: cat ./coverage/lcov.info > coverage.lcov
30-
- run: npx codecov
27+
- run: npm test
28+
- run: npm test -- --coverage-report=text-lcov | npx codecov --pipe

0 commit comments

Comments
 (0)