chore: migrate core, react, shadow-dom, update-shorthands to vitest#786
Open
layershifter wants to merge 8 commits intomicrosoft:mainfrom
Open
chore: migrate core, react, shadow-dom, update-shorthands to vitest#786layershifter wants to merge 8 commits intomicrosoft:mainfrom
layershifter wants to merge 8 commits intomicrosoft:mainfrom
Conversation
Replace Jest with Vitest for @griffel/core, @griffel/react,
@griffel/shadow-dom, and @griffel/update-shorthands. Also fix
webpack-plugin executor from @nx/vite:test to @nx/vitest:test.
- Add vitest.config.ts for each package
- Update project.json test targets to @nx/vitest:test
- Update tsconfig.spec.json with vitest types
- Delete jest.config.ts from each package
- Replace jest.* APIs with vi.* (jest.fn → vi.fn, jest.mock → vi.mock, etc.)
- Use explicit `import { ... } from 'vitest'` instead of globals
- Update snapshot serializers to use vitest's SnapshotSerializer type
- Fix @jest-environment annotations to @vitest-environment
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
📊 Bundle size report✅ No changes found |
- Remove unused `test` import from 11 files (only `it` is used) - Add `**/vitest.config.ts` to eslint no-extraneous-dependencies override - Add eslint-disable for pre-existing empty arrow function patterns Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…e.test Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
vi.mock() hoisting in vitest requires imports after mock setup. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
@griffel/core,@griffel/react,@griffel/shadow-dom, and@griffel/update-shorthandsfrom Jest to Vitest@griffel/webpack-pluginexecutor from@nx/vite:testto@nx/vitest:testimport { ... } from 'vitest'in all test files (no globals)jest.*APIs withvi.*equivalents, update snapshot serializer typesimport/firstfor test files in ESLint config (vi.mock()hoisting requires imports after mock setup)**/vitest.config.tsto ESLintimport/no-extraneous-dependenciesoverrideTest plan
nx run @griffel/core:test— 67 files, 429 tests passnx run @griffel/react:test— 9 files, 17 tests passnx run @griffel/shadow-dom:test— 2 files, 22 tests passnx run @griffel/update-shorthands:test— 5 files, 12 tests passnx run-many --target=type-checkpasses for all 4 packagesnx run @griffel/core:lintpassesnx run @griffel/react:lintpasses🤖 Generated with Claude Code