-
Notifications
You must be signed in to change notification settings - Fork 65
feat: migrate from Jest to Vitest #2069
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
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Migrate test runner from Jest to Vitest for significantly improved performance: - Frontend tests: 77.9s → 2.1s (37x faster) - API tests: 84.4s → 7.6s (11x faster) Changes: - Add vitest.frontend.config.ts and vitest.api.config.ts - Use node environment by default, jsdom only for DOM-requiring tests - Convert jest.mock/fn/spyOn to vi.mock/fn/spyOn across 17 test files - Add setup.vitest.ts with TextEncoder polyfill - Inline @across-protocol/* packages to resolve ESM issues - Update package.json test scripts to use vitest Co-Authored-By: Claude <noreply@anthropic.com>
5517da9 to
f6378cc
Compare
| expect(token).toBeUndefined(); | ||
| }); | ||
|
|
||
| it("should return undefined for a zero address if the native token is not in the token map", () => { |
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.
this test messed up the other with the nested mock.
If it is important, we can do the work of replacing it with another approach
|
Deployment failed with the following error: Learn More: https://vercel.link/3Fpeeb1 |
# Conflicts: # test/api/_bridges/cctp-sponsored/utils/signing.test.ts # test/api/_bridges/cctp/strategy.test.ts # test/api/_bridges/oft-sponsored/utils/signing.test.ts # test/api/_bridges/sponsored-intent/common.test.ts
# Conflicts: # test/api/_sponsorship-eligibility.test.ts
dohaki
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.
Great stuff! Wanted to get off jest for a while now 👏 Only a few nits
Motivation:
Fast unit tests are crucial for a good test writing experience. With AI, quick tests also let us iterate faster and run unit tests as part of workflow. Vite offers modern, easy-to-use testing tools and is notably faster.
Modification:
Migrate test runner from Jest to Vitest for significantly improved performance:
ci

before
after:

Changes:
Co-Authored-By: Claude noreply@anthropic.com