Skip to content

Commit 7a830fa

Browse files
committed
Setup nyc to produce code coverage reports
This extends the public TypeScript configuration and sets it to check just our source files. The `all` setting must be `false` otherwise the tool crashes with an OOM because the test runner launches VS Code instances. The coverage check is set to false because we'll enable failures for reduced coverage later. The reports generated will go into Azure DevOps (cobertura) and Codecov (lcov, which also produces HTML output), and a summary is printed to the console.
1 parent 12e560e commit 7a830fa

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

package.json

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,24 @@
8282
"scripts": {
8383
"lint": "tslint --project tsconfig.json",
8484
"build": "tsc --project tsconfig.json && esbuild ./src/main.ts --outdir=out --sourcemap --bundle --minify --external:vscode --platform=node",
85-
"test": "node ./out/test/runTests.js",
85+
"test": "nyc node ./out/test/runTests.js",
8686
"package": "vsce package --no-gitHubIssueLinking",
8787
"publish": "vsce publish"
8888
},
89+
"nyc": {
90+
"extends": "@istanbuljs/nyc-config-typescript",
91+
"all": false,
92+
"check-coverage": false,
93+
"include": [
94+
"src/**/*.ts",
95+
"out/**/*.js"
96+
],
97+
"reporter": [
98+
"cobertura",
99+
"lcov",
100+
"text-summary"
101+
]
102+
},
89103
"contributes": {
90104
"breakpoints": [
91105
{

0 commit comments

Comments
 (0)