Skip to content

refactor: migrate to vitest#1092

Merged
antfu merged 31 commits intomainfrom
feat/vitest
Dec 28, 2021
Merged

refactor: migrate to vitest#1092
antfu merged 31 commits intomainfrom
feat/vitest

Conversation

@antfu
Copy link
Copy Markdown
Member

@antfu antfu commented Dec 23, 2021

Thanks a lot to @JessicaSachs 🙌

@JessicaSachs
Copy link
Copy Markdown
Contributor

So I was getting an issue before I upgraded to 0.0.108 where those tests would fail. (the "tests magically work now" commit).

I think the upgrade to 0.0.108 made vitest fast enough that the race condition isn't apparent on my machine, but it still fails in CI (slower CPU, etc). All of the tests that are broken mock or other-wise reset window/DOM state. e.g. document.location, window.localStorage, window.navigator, document.body

To reproduce the failure, you must run all tests together. Most of the time I spent was trying to debug why those tests were failing. I couldn't figure it out. I think, environmentally, this environment isn't as pure/sandboxed as jest's jsdom resets.

@antfu antfu merged commit 3b9a7b4 into main Dec 28, 2021
@antfu antfu deleted the feat/vitest branch December 28, 2021 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants