Skip to content
Discussion options

You must be logged in to vote

Vitest can collect coverage of files that are loaded through Vite. Files that are run using node:worker_threads, node:child_process or require() are not intercepted by Vite. This also means that Vitest mocks or other similar features are not available inside such files.

Even if Vitest used tools like spawn-wrap to overwrite node:child_process APIs just for code instrumentation, we would still need to figure out where to get source maps as Vite would not have those now. I'm not saying it's impossible, but I think it would require quite complex setup.

There's some related discussion here: #2911.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@nujarum
Comment options

@AriPerkkio
Comment options

Answer selected by nujarum
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants