Skip to content

Commit ce85573

Browse files
committed
Replace c8 to native node --test coverage
1 parent 8a35b1a commit ce85573

File tree

5 files changed

+15
-357
lines changed

5 files changed

+15
-357
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,4 @@ jobs:
5050
- name: Install dependencies
5151
run: pnpm install --ignore-scripts
5252
- name: Run unit tests
53-
run: pnpm unit
53+
run: pnpm bnt

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ function findMatchingParen(str, startIndex) {
4343
if (str[i] === '(') depth++
4444
else if (str[i] === ')') depth--
4545
if (depth === 0) return i
46+
/* node:coverage ignore next 2 */
4647
}
47-
/* c8 ignore next */
4848
return -1
4949
}
5050

package.json

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
"smooth"
1111
],
1212
"scripts": {
13-
"unit": "node --test index.test.js",
14-
"test:coverage": "c8 node --test index.test.js",
13+
"test:coverage": "bnt --coverage 100",
1514
"test:lint": "eslint .",
1615
"test": "pnpm run /^test:/"
1716
},
@@ -37,7 +36,7 @@
3736
"devDependencies": {
3837
"@logux/eslint-config": "^56.1.0",
3938
"actions-up": "^1.4.1",
40-
"c8": "^10.1.3",
39+
"better-node-test": "^0.8.3",
4140
"clean-publish": "^5.2.2",
4241
"eslint": "^9.37.0",
4342
"multiocular": "^0.8.1",
@@ -51,14 +50,6 @@
5150
"singleQuote": true,
5251
"trailingComma": "none"
5352
},
54-
"c8": {
55-
"exclude": [
56-
"*.test.*"
57-
],
58-
"lines": 100,
59-
"reporter": "lcov",
60-
"check-coverage": true
61-
},
6253
"clean-publish": {
6354
"cleanDocs": true
6455
}

0 commit comments

Comments
 (0)