Skip to content

Commit 052a024

Browse files
committed
Enhancement: Generate test coverage reports after npm test (#2289)
Signed-off-by: Jesse <[email protected]>
1 parent e89cec2 commit 052a024

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

.c8rc.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"reporter": [
3+
"html",
4+
"text"
5+
],
6+
"reportsDirectory": "./coverage",
7+
"src": [
8+
"src"
9+
],
10+
"exclude": [
11+
"std/**/*",
12+
"tests/**/*",
13+
"dist/**/*",
14+
"bin/asinit.js",
15+
"lib/**/*",
16+
"scripts/**/*",
17+
"src/glue/wasm/**/*",
18+
"util/browser/**/*"
19+
],
20+
"clean": true,
21+
"exclude-after-remap": true
22+
}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ raw/
99
.idea
1010
cli/index.generated.js
1111
src/diagnosticMessages.generated.ts
12+
coverage/

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131
"esbuild": "^0.14.1",
3232
"eslint": "^8.2.0",
3333
"glob": "^7.2.0",
34-
"typescript": "~4.5.2"
34+
"typescript": "~4.5.2",
35+
"c8": "^7.11.2"
3536
},
3637
"type": "module",
3738
"exports": {
@@ -65,7 +66,8 @@
6566
"lint": "eslint --max-warnings 0 --ext js . && eslint --max-warnings 0 --ext ts .",
6667
"build": "node scripts/build",
6768
"watch": "node scripts/build --watch",
68-
"test": "npm run test:parser && npm run test:compiler -- --parallel && npm run test:browser && npm run test:asconfig && npm run test:transform",
69+
"test": "c8 npm run test:runner",
70+
"test:runner":"npm run test:parser && npm run test:compiler && npm run test:browser && npm run test:asconfig && npm run test:transform",
6971
"test:parser": "node --enable-source-maps tests/parser",
7072
"test:compiler": "node --enable-source-maps --experimental-wasi-unstable-preview1 --no-warnings tests/compiler",
7173
"test:browser": "node --enable-source-maps tests/browser",

0 commit comments

Comments
 (0)