You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I run the test in the repo, I do not see inline coverage in the editor. And in the Window output I see an error: [error] Error loading coverage details Illegal argument: character must be non-negative.
Reproduction
Run the test from the repo https://github.com/motz-art/vscode-vitest-coverage-issue.git.
Expected:
Inline code coverage is shown in the editor.
Actual:
Only high level coverage info is shown but inline coverage info (code lines are not highlighted) is missing.
At the same time Window output shows one error: Error loading coverage details Illegal argument: character must be non-negative
Note: When I change the test to call process(1); instead, then inline code coverage is shown properly:
Output
[INFO 1:12:46 PM] [v1.8.3] Vitest extension is activated because Vitest is installed or there is a Vite/Vitest config file in the workspace.
[INFO 1:12:47 PM] [API] Running Vitest v2.1.8 (vitest-coverage-issue/vitest.config.js) with [email protected]: C:\Program Files\nodejs\node.EXE
[INFO 1:12:48 PM] [Worker] �[33mThe CJS build of Vite's Node API is deprecated. See https://vite.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.�[39[INFO 1:12:48 PM] [API] Vitest v2.1.8 (vitest-coverage-issue/vitest.config.js) child process 75792 created[INFO 1:12:48 PM] [API] Watching C:/git/TMP/vitest-coverage-issue/vitest.config.js[INFO 1:12:48 PM] [VSCODE] Watching vitest-coverage-issue with pattern **/*[INFO 1:12:48 PM] [API] Collecting tests: index.spec.js[1:12:48 PM] Not starting the runner because tests are being collected for index.spec.js[1:12:48 PM] [VSCODE] Ignoring file: index.spec.js.git[1:12:48 PM] [VSCODE] Ignoring file: index.js.git[1:12:48 PM] There is no test run for "index.spec.js"[1:12:48 PM] No test run to finish for index.spec.js[1:12:48 PM] [VSCODE] Ignoring file: node_modules\.vite\vitest\results.json[1:12:58 PM] [VSCODE] Ignoring file: .git\FETCH_HEAD[1:12:58 PM] [VSCODE] Ignoring file: .git\FETCH_HEAD[1:12:59 PM] [VSCODE] Ignoring file: index.spec.js.git[1:12:59 PM] [VSCODE] Ignoring file: index.js.git[INFO 1:13:02 PM] [Worker] Running coverage with configuration: { provider: 'v8', enabled: true, all: true, clean: true, cleanOnRerun: true, reportsDirectory: 'C:/Users/Oleg/AppData/Local/Temp/vitest-coverage-bb25e8a0-148e-43b7-b79a-49b79408bd62', exclude: ['coverage/**','dist/**','**/node_modules/**','**/[.]**','packages/*/test?(s)/**','**/*.d.ts','**/virtual:*','**/__x00__*','**/\x00*','cypress/**','test?(s)/**','test?(-*).?(c|m)[jt]s?(x)','**/*{.,-}{test,spec,bench,benchmark}?(-d).?(c|m)[jt]s?(x)','**/__tests__/**','**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build,eslint,prettier}.config.*','**/vitest.{workspace,projects}.[jt]s?(on)','**/.{eslint,mocha,prettier}rc.{?(c|m)js,yml}' ], reportOnFailure: true, reporter: [ [ 'json', [Object] ] ], extension: ['.js', '.cjs','.mjs', '.ts','.mts', '.tsx','.jsx', '.vue','.svelte', '.marko','.astro' ], allowExternal: false, excludeAfterRemap: false, ignoreEmptyLines: true, processingConcurrency: 16[1:13:02 PM] Initiating deferred test run[INFO 1:13:02 PM] Running all tests in vitest-coverage-issue[1:13:02 PM] The runner is starting because tests index.spec.js were started due to a file change[1:13:02 PM] Enqueuing "should show coverage"[1:13:02 PM] No task result for "index.spec.js", ignoring[1:13:02 PM] Enqueuing "should show coverage" because it was just collected[1:13:02 PM] No errors found for "index.spec.js"[1:13:02 PM] Marking "should show coverage" as passed[INFO 1:13:02 PM] [Worker] Waiting for the coverage report to generate: C:/Users/Oleg/AppData/Local/Temp/vitest-coverage-bb25e8a0-148e-43b7-b79a-49b79408bd6[INFO 1:13:02 PM] [Worker] Coverage reports retrieved: C:/Users/Oleg/AppData/Local/Temp/vitest-coverage-bb25e8a0-148e-43b7-b79a-49b79408bd6[1:13:02 PM] Ending test run index.spec.js[1:13:02 PM] Coverage was disabled due to all requests being exhausted[INFO 1:13:02 PM] Removed coverage reports C:/Users/Oleg/AppData/Local/Temp/vitest-coverage-bb25e8a0-148e-43b7-b79a-49b79408bd62[1:13:02 PM] [VSCODE] Ignoring file: node_modules\.vite\vitest\results.json[1:13:08 PM] [VSCODE] Ignoring file: .git\FETCH_HEAD[1:13:08 PM] [VSCODE] Ignoring file: .git\FETCH_HEAD[1:13:09 PM] [VSCODE] Ignoring file: index.spec.js.git[1:13:09 PM] [VSCODE] Ignoring file: index.js.git
Extension Version
1.8.3
Vitest Version
2.1.8
Validations
Check that you are using the latest version of the extension
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Describe the bug
When I run the test in the repo, I do not see inline coverage in the editor. And in the Window output I see an error:
[error] Error loading coverage details Illegal argument: character must be non-negative
.Reproduction
Expected:
Inline code coverage is shown in the editor.
Actual:
Only high level coverage info is shown but inline coverage info (code lines are not highlighted) is missing.
At the same time Window output shows one error:
Error loading coverage details Illegal argument: character must be non-negative
Note: When I change the test to call
process(1);
instead, then inline code coverage is shown properly:Output
Extension Version
1.8.3
Vitest Version
2.1.8
Validations
The text was updated successfully, but these errors were encountered: