-
Notifications
You must be signed in to change notification settings - Fork 1.1k
chore: migrate some tests from jest to vitest #20568
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
Conversation
| it("validation passes for all timezones", () => { | ||
| for (const zone of timeZones) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I converted this to a for loop because this feels like one test, but before it was basically being treated as almost six hundred tests. "number of tests" isn't a great metric, but having over half of our "tests" coming from this < 10 loc skews that metric into "incredibly misleading" territory, which isn't great.
| "test:watch": "jest --selectProjects test --watch", | ||
| "test": "vitest run && jest", | ||
| "test:ci": "vitest run && jest --silent", | ||
| "test:watch": "vitest", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw you removed test:coverage, have we ever actually used that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope! 😄 and coverage reporting right now would be broken anyway, since each test framework is only seeing part of the story.
jaaydenh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ran the tests and seems to be working fine. 👍
Im curious if the deleted tests are not relevant anymore or if there were other reasons to remove them.
Migrates the majority of tests that will be "easy" to migrate; 201 tests specifically. This leaves 399 tests running under Jest.
Many of the tests are broken because of something to do with our
renderWithAuthfunction, and I imagine hunting down that issue alone would fix another couple hundred.I imagine another large chunk of tests will be relatively easy to automate with an agent. Translating things where the Vitest API is similar to Jest's but not quite 1:1.
I think some tests are going to be a pain to migrate, but probably < 100. While converting these we should continue to evaluate how much value we're getting out of them vs maintenance burden, considering if Storybook and our e2e tests already give us sufficient coverage or not.