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

Errors during tests don't get reported correctly #444

Closed
4 tasks done
AlexPaven opened this issue Aug 1, 2024 · 0 comments · Fixed by #445
Closed
4 tasks done

Errors during tests don't get reported correctly #444

AlexPaven opened this issue Aug 1, 2024 · 0 comments · Fixed by #445

Comments

@AlexPaven
Copy link

Describe the bug

For a test that throws an error, test results show "TypeError: n.getBrowserSourceMapModuleById is not a function" instead of the actual error.

Full output on Test Results tab:
⎯⎯⎯⎯⎯⎯ Unhandled Errors ⎯⎯⎯⎯⎯⎯

Vitest caught 1 unhandled error during the test run.
This might cause false positive tests. Resolve unhandled errors to make sure your tests are not affected.

⎯⎯⎯⎯⎯⎯ Unhandled Error ⎯⎯⎯⎯⎯⎯⎯
TypeError: n.getBrowserSourceMapModuleById is not a function
❯ Object.getSourceMap ../../Users/apaven/.vscode/extensions/vitest.explorer-1.0.5/dist/worker.js:39:3421
❯ ../../Users/apaven/.vscode/extensions/vitest.explorer-1.0.5/dist/worker.js:13:11868
❯ Ju ../../Users/apaven/.vscode/extensions/vitest.explorer-1.0.5/dist/worker.js:13:11814
❯ ts ../../Users/apaven/.vscode/extensions/vitest.explorer-1.0.5/dist/worker.js:15:131
❯ ../../Users/apaven/.vscode/extensions/vitest.explorer-1.0.5/dist/worker.js:39:3397
❯ ../../Users/apaven/.vscode/extensions/vitest.explorer-1.0.5/dist/worker.js:39:3352
❯ xr.onTaskUpdate ../../Users/apaven/.vscode/extensions/vitest.explorer-1.0.5/dist/worker.js:39:3286

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯

Reproduction

https://github.com/AlexPaven/vitest-repro (test which throws an error with minimal config)

checkout + pnpm i; pnpm test reports errors correctly, Vitest Explorer does not

OS: win11

Output

[INFO 1:21:50 PM] [API] Running Vitest v2.0.5 (vitest-repro/vitest.config.ts) with Node.js: C:\Program Files\nodejs\node.EXE
[INFO 1:21:51 PM] [API] Vitest v2.0.5 (vitest-repro/vitest.config.ts) process 24644 created
[INFO 1:21:51 PM] [API] Collecting tests: sample.test.ts
[INFO 1:22:12 PM] Running 1 file(s) with name pattern: ^\s?sample test$

Version

1.0.5

Validations

@github-actions github-actions bot locked and limited conversation to collaborators Aug 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant