-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Rerun setupFiles in watch mode #2614
Comments
The |
This does sound better to me. I don't expect these files to change as much as the actual tests during active development, so rerunning them every time might be a bit of a waste, so your suggested optimisation does sound good to me. |
I think we can just add setupFiles to |
Great! Thanks for your advice, I will try to solve it. |
I'm not sure this will help... As I've mentioned in OP even when I rerun all the tests forcefully by pressing |
Aha, I am not really make sure, but I test it in this demo, I get the same result with you, the |
Co-authored-by: Vladimir Sheremet <sleuths.slews0s@icloud.com> fix #2614
Co-authored-by: Vladimir Sheremet <sleuths.slews0s@icloud.com> fix vitest-dev/vitest#2614
Co-authored-by: Vladimir Sheremet <sleuths.slews0s@icloud.com> fix vitest-dev#2614
Clear and concise description of the problem
I'm mocking http requests using msw and as suggested in vitest docs I'm putting my handlers in setup files.
While running vitest in watch mode I want to edit handlers and to have these changes applied before rerun of tests. However changes to setup files aren't being picked up in watch mode even if I forcefully rerun all tests. I need to restart vitest for changes to apply.
Suggested solution
Rerun all setupFiles in watch mode, or add an option to do that on a per-file basis.
Alternative
An alternative is probably using something like nodemon and then run
vitest --run
, but it probably isn't really worth the trouble, hopefully, I won't have to make many changes to mocked API once it's done.Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: