-
Notifications
You must be signed in to change notification settings - Fork 900
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
Convert e2e unit tests to use Jest #8666
Conversation
|
Size Report 1Affected ProductsNo changes between base commit (cb4309f) and merge commit (f7a18ca).Test Logs |
Size Analysis Report 1Affected ProductsNo changes between base commit (cb4309f) and merge commit (f7a18ca).Test Logs |
Have you guys considered vitest https://github.com/vitest-dev/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.
💥
Thanks! Yes, I considered vitest. We might migrate to it eventually if it becomes more popular, which it seems to be on its way to becoming. I went with Jest because it's currently the most commonly used, users often report issues with it, and so catching errors in it will impact the most users. If vitest grows in popularity I would love to move over, especially for real browser testing. We could also maybe do both, will put it in our wishlist. |
E2E tests have been broken since upgrading TypeScript from 4 to 5. The reason is that between TypeScript 5.2.2 and TypeScript 5.3.3, an internal property on sourceFiles,
resolvedModules
was removed, and moved toProgram
. See PR: microsoft/TypeScript#55790 This causedkarma-typescript
, which we use for the karma tests, to break as it was depending on that field to find modules and determine if it should bundle files.karma-typescript
is deprecated and no longer maintained so we can't get a fix from it even though we know the problem.In light of this, I'm migrating our E2E tests from karma to Jest.
Pros:
Cons:
Details
useFetchStreams
on Firestore tests as JSDOM does not handle fetch readable streams well. There's no public API to turn it off in compat so I had to do it pretty hacky.