Skip to content

Commit

Permalink
test: Change coverage config to be vite compatible
Browse files Browse the repository at this point in the history
This inclusion stanza excludes node_modules as well as the test files.

Also, update launch.json to allow debuggin in vscode and fix a broken html comment.

Merge branch 'main' into melink14/vitejs
  • Loading branch information
melink14 committed Dec 18, 2024
2 parents a443d76 + 2560055 commit bad5ade
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 197 deletions.
4 changes: 3 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
"address": "localhost",
"port": 9333,
"sourceMaps": true,
"trace": true
"trace": true,
// Needed for vite based project.
"webRoot": "${workspaceFolder}/extension"
}
]
}
194 changes: 0 additions & 194 deletions package-lock.json

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

6 changes: 4 additions & 2 deletions web-test-runner.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@ if (isDocker) {
const defaultConfig = {
rootDir: 'extension',
coverageConfig: {
exclude: ['**/*_test.ts*'],
// Including this excludes tests and random node_module files from the report.
// Excluding doesn't appear to do anything with vite.
include: ['**/extension/*.ts'],
},

browsers: [
Expand Down Expand Up @@ -155,7 +157,7 @@ const defaultConfig = {
testRunnerHtml: (testFramework) =>
`<html>
<body>
<-- vite doesn't add global by default so add it here. -->
<!-- vite doesn't add global by default so add it here. -->
<script>
window.global ||= window;
</script>
Expand Down

0 comments on commit bad5ade

Please sign in to comment.