Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add code coverage #93

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
7 changes: 7 additions & 0 deletions .c8rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"all": true,
"src": ["client/src", "server/src"],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little confused. Does this src setting really take effect? If so, sounds like "client/out/test/" doesn't need to be excluded as it won't be included? I looked at latest build log, tools/build.mjs is also in the report.

"exclude": ["**/node_modules/**", "client/out/test/"],
"reporter": ["html", "text"],
"lines": 75
}
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ jobs:
- run: npm ci
- run: npm run format:check
- run: npm run copyright:check
- run: xvfb-run -a npm run test
- run: xvfb-run -a npm run coverage
if: runner.os == 'Linux'
- run: npx vsce package
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ dist
node_modules
.vscode-test*
*.vsix
*.node
*.node
coverage/
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
registry=https://registry.npmjs.org
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ server/**/*.json

# VSCode history
.history/

coverage/
3 changes: 3 additions & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ ContributorAgreement.txt
.travis.yml
.eslintignore
pull_request_template.md
.eslintrc.js
.c8rc
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does coverage/ need to be added here too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@scnwwu agreed, will add that to the list here.

coverage/
176 changes: 176 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,7 @@
"format": "prettier --write .",
"pretest": "npm run compile && tsc -p ./client",
"test": "node ./client/out/test/runTest.js",
"coverage": "c8 --clean npm run test",
"postinstall": "cd client && npm install && cd ../server && npm install && cd ..",
"copyright:check": "node ./tools/check-copyright.mjs"
},
Expand All @@ -611,6 +612,7 @@
"@types/sinon": "^10.0.13",
"@typescript-eslint/eslint-plugin": "^5.57.0",
"@typescript-eslint/parser": "^5.57.1",
"c8": "^7.12.0",
"chai": "^4.3.7",
"esbuild": "^0.17.16",
"eslint": "^8.37.0",
Expand Down