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
While debugging a Vitest test case using the VSCode plugin's "Debug Test" functionality, output generated by the test case using console.log does not show up in the Test results pane immediately when the console.log call is performed; it only shows up at some later time. This is very confusing and hinders debugging.
Reproduction
The repro is here. To reproduce, put a breakpoint on the console.log line in index.test.mjs. Then choose Debug Test in the Testing view. Then choose Step Over. Notice no output appears in the Test results pane.
Output
[INFO 13:38:16] [v1.6.9] Vitest extension is activated because Vitest is installed or there is a Vite/Vitest config file in the workspace.
[INFO 13:38:19] [API] Running Vitest v2.1.5 (vitest-repro/vitest.config.js) with [email protected]: /Users/bartj/.nvm/versions/node/v22.9.0/bin/node
[INFO 13:38:21] [API] Vitest v2.1.5 (vitest-repro/vitest.config.js) child process 36769 created
[INFO 13:38:21] [VSCODE] Watching vitest-repro with pattern **/*
[INFO 13:38:21] [API] Collecting tests: index.test.mjs
[13:38:21] Not starting the runner because tests are being collected for index.test.mjs
[13:38:22] [VSCODE] File deleted: vitest.config.js.timestamp-1732019901325-e73096b854411.mjs
[13:38:24] There is no test run for"index.test.mjs"
[13:38:24] No test run to finish for index.test.mjs
[13:38:25] [VSCODE] Ignoring file: node_modules/.vite/vitest/results.json
[INFO 13:38:30] [DEBUG] Starting debugging session /Users/bartj/.nvm/versions/node/v22.9.0/bin/node
[INFO 13:38:31] [DEBUG] Debugging started
[13:38:32] Initiating deferred test run
[INFO 13:38:32] Running 1 file(s) with name pattern: ^\s?Test Suite hello world!$
[13:38:32] The runner is starting because tests index.test.mjs were started due to a file change
[13:38:32] Enqueuing "hello world!"
[13:38:32] [VSCODE] File deleted: vitest.config.js.timestamp-1732019912764-b342c42c65b0d.mjs
[13:38:33] No task result for"index.test.mjs", ignoring
[13:38:33] No task result for"Test Suite", ignoring
[13:38:33] Enqueuing "hello world!" because it was just collected
[13:38:47] No errors found for"index.test.mjs"
[13:38:47] No errors found for"Test Suite"
[13:38:47] Marking "hello world!" as passed
[13:38:47] Ending test run index.test.mjs
[13:38:48] [VSCODE] Ignoring file: node_modules/.vite/vitest/results.json
[13:38:48] [API] Vitest WebSocket connection closed, cannot call RPC anymore.
[13:38:48] Disposing test runner
[13:38:48] Ending test run <none>
Version
1.6.10
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.
I found a workaround: add disableConsoleIntercept: true to the test object in vitest.config.js; then console.log output appears in the Debug console immediately.
Describe the bug
While debugging a Vitest test case using the VSCode plugin's "Debug Test" functionality, output generated by the test case using
console.log
does not show up in the Test results pane immediately when theconsole.log
call is performed; it only shows up at some later time. This is very confusing and hinders debugging.Reproduction
The repro is here. To reproduce, put a breakpoint on the
console.log
line inindex.test.mjs
. Then choose Debug Test in the Testing view. Then choose Step Over. Notice no output appears in the Test results pane.Output
Version
1.6.10
Validations
The text was updated successfully, but these errors were encountered: