vitest icon indicating copy to clipboard operation
vitest copied to clipboard

fix: vitest cannot read the latest config when it changes

Open stygian-desolator opened this issue 3 years ago • 4 comments

Description

close #983 close #982 close #981

stygian-desolator avatar Mar 22 '22 08:03 stygian-desolator

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...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

netlify[bot] avatar Mar 22 '22 08:03 netlify[bot]

I am not sure about this approach, can't we avoid mutation somehow?

antfu avatar Mar 23 '22 06:03 antfu

Or... Maybe this is a bug in vite 🤔 ? When the config is changed, the previous options are remembered even though vite restarts the server.

stygian-desolator avatar Mar 23 '22 06:03 stygian-desolator

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

sapphi-red avatar Mar 23 '22 10:03 sapphi-red

I think this is fixed now?

sheremet-va avatar Oct 11 '22 14:10 sheremet-va

@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.

sapphi-red avatar Oct 12 '22 11:10 sapphi-red