-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
fix(browser): userEvent.setup initiates a separate state for userEvent instance #6088
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
fix(browser): userEvent.setup initiates a separate state for userEvent instance #6088
Conversation
|
@edoardocavazza I am actually not sure about having a global state - it leaks to other tests (I had to add |
|
I suppose that a "global state" actually exists anyway on the playwright/webdriver side. Consider this test: A vitest global state should be useful to reset the keyboard state between tests. |
|
|
Sorry, I may have misunderstood the question. |
|
Yes, I was saying in my previous question that I also found those leaks, but I am not sure what to do with them. Do we resolve them automatically? If you had more tests in between, or |
|
Ok, now I understand your concerns. My opinion is that however we need to deviate slightly from the functioning of the original library. Automatic cleaning at the end of each test seems to me to be the most desired solution. It should be the developer's responsibility to make sure to clean up the test state by using |
be15d61 to
5121921
Compare
✅ Deploy Preview for vitest-dev ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Description
Closes #6082
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
pnpm-lock.yamlunless you introduce a new test example.Tests
pnpm test:ci.Documentation
pnpm run docscommand.Changesets
feat:,fix:,perf:,docs:, orchore:.