Repository navigation
chore(deps-dev): bump vitest from 2 to 4 and migrate config - #3850
Merged
Merged
Conversation
Bump vitest (and @vitest/coverage-v8) to 4.1.9 across the root and docsite, and migrate the config/tests for Vitest 4's breaking changes: - Replace the removed `vitest.workspace.ts` with inline `test.projects` in vitest.config.ts, preserving the ui/node partitioning. - Move the removed `poolOptions.forks.execArgv` to the top-level `execArgv`. - Fix the sharedResizeObserver mock: Vitest 4 constructs mocks called with `new`, so the ResizeObserver mock must use a function expression, not an arrow. - Fix the ESLint RuleTester tests (boolean-prop-naming, copyright-header, no-hardcoded-anchor, no-raw-paragraph): RuleTester registers its own describe/it internally, which Vitest 4 forbids inside another `it()`. Call `ruleTester.run(...)` at the top level, and add the now-required `suggestions` assertions that the previously-skipped cases never exercised. - no-raw-paragraph: dedupe the double-report of a destructured element-type default (the Property visitor already covers what the AssignmentPattern visitor was also flagging) — surfaced once the RuleTester cases actually run. - Add "node" to the tsconfig `types` so `node:fs` types resolve; the new dep graph otherwise left them unresolved, turning `readdirSync` results into `any` and producing spurious type-aware lint errors on unrelated core files. Verified locally: pnpm build, storybook/core typechecks, the full test suite, and CI-mode lint all pass.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Vitest 4's stricter vi.fn() return typing made the mock's inferred shape incompatible with the global ResizeObserver constructor under tsc, breaking the core typecheck (tests included). Cast the mock to typeof ResizeObserver.
josephfarina
approved these changes
Jul 11, 2026
Contributor
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR No new or modified components detected. Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
…est 4 The build-theme.* suites need a compiled @astryxdesign/core and build it on demand from their beforeAll via a filesystem-locked helper. Under Vitest 4's reworked pool scheduling, a worker could fall through to the fallback build path and run core's `rimraf dist && build` while another suite was reading dist, failing with "Could not resolve dist/index.js". Build core once in a `node`-project globalSetup, before any worker forks, so every suite's beforeAll short-circuits on the existing dist and no two builds ever run concurrently.
cixzhang
pushed a commit
that referenced
this pull request
Jul 12, 2026
With vitest 2->4 (#3850) and the single-vite-7 catalog (#3847) landed, the remaining vite 8 step is a version alignment: - catalog: vite ^7.3.6 -> ^8.1.3 (8.1.4 is still inside the 7-day minimumReleaseAge window) - root @vitejs/plugin-react ^4.3.0 -> ^5.2.0: 4.x peers stop at vite 7, 5.2.0 supports vite ^4-^8. plugin-react 6 is vite-8-only and adds a react-compiler peer, so it is left for a follow-up. - the standalone example apps and the vibe-tests preview app pin vite ^8.1.3 + plugin-react ^5.2.0 by hand — they live outside the workspace, so the catalog bump does not reach them - packages/build keeps "vite": "catalog:" as its peer (storybook and sandbox still depend on it in-workspace; a floating peer range is how the two-vite split of 2e64c59 happened), which narrows its published peer to ^8.1.3 on the next release Verified: exactly one vite (8.1.3) in the lockfile; storybook tsc and a full storybook build on rolldown; root (6247 tests) and docsite (217) suites green; packages/build builds. vibe-tests preview:build fails identically on main with vite 7 (missing tailwind.css import and a directory alias) — pre-existing, not a vite 8 regression.
This branch was successfully deployed
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.
Supersedes #3836 (the Dependabot vitest bump), which failed CI on lint, test, and build.
What
Bumps
vitest(and@vitest/coverage-v8) from 2.x to 4.1.9 across the root and docsite, and migrates the config and tests for Vitest 4's breaking changes.Why the Dependabot PR failed
Vitest 4 is a two-major bump with several breaking changes the raw version bump didn't account for:
vitest.workspace.tswas removed in favor of inlinetest.projects. Without migrating, theui/nodeproject partitioning was ignored, so thenodeproject's globs pulled inapps/docsitetests (which need generated files) and failed to resolve@astryxdesign/core.poolOptionswas removed — its options are now top-level (execArgv).newnow construct — an arrow-functionvi.fn()used as aResizeObserverconstructor throws<anonymous> is not a constructor.it()— ESLint'sRuleTester.run()registers its owndescribe/it, so wrapping it init()now errors. These tests were effectively vacuous before (the inner cases never ran).Changes
vitest.workspace.ts→test.projectsinvitest.config.ts, preserving the ui/node split; movepoolOptions.forks.execArgvto top-levelexecArgv.sharedResizeObservermock to use a function expression.ruleTester.run(...)at the top level, and add the now-requiredsuggestionsassertions the skipped cases never exercised.no-raw-paragraph: dedupe a double-report of a destructured element-type default (thePropertyvisitor already covers whatAssignmentPatternwas also flagging) — surfaced only once the RuleTester cases actually run."node"to the tsconfigtypesarray sonode:fstypes resolve. The new dependency graph otherwise left them unresolved, collapsingreaddirSyncresults toanyand producing spurious type-aware lint errors (promise-function-async,no-unnecessary-type-assertion) on unrelated core files.Verification
Locally:
pnpm build, the storybook + core typechecks, the fullpnpm testsuite (332 files, 6232 tests), and CI-mode lint all pass.