fix: vitest cannot read the latest config when it changes
Description
close #983 close #982 close #981
Deploy Preview for vitest-dev ready!
| Name | Link |
|---|---|
| Latest commit | 8a331ca6e160f2b9385c7e45f497c86771b3bb8b |
| Latest deploy log | https://app.netlify.com/sites/vitest-dev/deploys/623a80a48c3c4e0008d4bd81 |
| Deploy Preview | https://deploy-preview-1001--vitest-dev.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site settings.
I am not sure about this approach, can't we avoid mutation somehow?
Or... Maybe this is a bug in vite 🤔 ?
When the config is changed, the previous options are remembered even though vite restarts the server.
Sorry for interrupting. I dont think this PR will fix #981 #982.
Because these issues are happening by inconsistency between globTestFiles and isTargetFile (which is used in watcher.on('add', onAdd)). Also config change is not required to reproduct #981 and #982.
https://github.com/vitest-dev/vitest/blob/c9f53f21f341bf119c4009115c94375a2aaa39d8/packages/vitest/src/node/core.ts#L397
https://github.com/vitest-dev/vitest/blob/c9f53f21f341bf119c4009115c94375a2aaa39d8/packages/vitest/src/node/core.ts#L432
I think this is fixed now?
@sheremet-va I tested the repro of #983 and it worked with the latest version. For #981 and #982, those are fixed by #1070. So it's fixed.