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
vitest doesn't work well with custom compiler #1003
Comments
I've tried adding some debug logging, and I see no reason why this happens
And this is what swc compiler shows:
My lib changes:
|
Added https://www.npmjs.com/package/why-is-node-running
|
This doesn't happen with |
Seems like it's due to how plugin handles exit, it depends on watchMode |
I've created small wrapper package https://www.npmjs.com/package/vite-plugin-typescript for this issue |
Not sure what we can do here? Maybe exit gracefully? Maybe an option? All plugins are run with |
Also I think |
I wonder why we should run them in watch: true when using non watch test mode |
I think it is needed for some internal Vite process. It also makes sense because we are running a server and transform files when needed. So from our perspective everything is correct. If watch mode is disabled, how can Vite know not to end process? |
Well then it might be good idea to expose VITEST_MODE earlier, so plugins can check it |
Mode is resolved after server has started, because it can be overwritten in your config. If we could resolve config before, it would be nice, but |
Is it still valid that vitest cannot signal it's running in watch mode to vite/rollup plugin api (e.g via config)? |
No, Vitest watch mode has nothing to do with Vite. It's enabled by {
test: { watch: true }
} The last one is the reason why we can't set |
Also seen discussions about plugins option under test section. |
Describe the bug
When using @rollup/plugin-typescript as compiler for tests I'm getting
close timed out after 1000ms
warning after successful runReproduction
wight554/blog-template#30
CI checks can be used for reference
System Info
Used Package Manager
yarn
Validations
The text was updated successfully, but these errors were encountered: