added vitest setup - #476
Merged
Merged
Conversation
|
@blockchainrafik Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Contributor
|
Thanks for the contribution here — squash-merging this now. Any follow-ups we'll track in a fresh issue. 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Based on my full audit of the codebase, here's the PR description:
chore: migrate from Jest to Vitest
Summary
Replaces Jest with Vitest as the test runner across the monorepo, eliminating the need for Babel/
ts-jesttransforms and aligning the test toolchain with the existing Vite/Rollup build pipeline.Changes
vitestand@vitest/coverage-v8as dev dependencies; removed Jest andts-jestjest.config.jswithvitest.config.ts— configuresglobals: true,environment: node, coverage viav8, and the correctincludeglobs forsrc/tests/**andtests/**packages/react/vitest.config.ts— setsenvironment: jsdom, pointssetupFilesatsrc/__tests__/setup.tswhich imports@testing-library/jest-dom/vitestimport { jest } from '@jest/globals'withimport { vi, ... } from 'vitest'; updated alljest.fn()→vi.fn(),jest.spyOn()→vi.spyOn(),jest.mock()→vi.mock(), etc.package.jsonscripts:"test": "vitest run","test:watch": "vitest"testjob now runsnpx vitest --run;@streamfi/reactjob also runsnpx vitest --runMotivation
Jest requires
ts-jestand Babel transforms to handle modern ESM and TypeScript in this project. Vitest runs natively with the same Vite config, has a near-identical API (vimirrorsjest), and is significantly faster in both single-run and watch modes.Test Results
Closes #343