Bump Vitest to v4 to unblock @storybook/addon-vitest#4260
Merged
Conversation
- `vitest` `^2.1.9` -> `^4.1.6` - `@vitest/web-worker` `3.1.4` -> `^4.1.6` - `vitest-canvas-mock` `0.3.3` -> `^1.1.4`
- `__mocks__/zustand` now uses `vi.importActual`; renamed to `.mts` for top-level `await` under `nodenext`. v4 redirected the static `import ... from 'zustand'` back into the mock, causing infinite recursion. - `__mocks__/monaco-editor`'s `ResizeObserver` and the `Logger` factories in `graphql-language-service-server` tests switched to real classes — v4 forbids calling `vi.fn().mockReturnValue()` / `.mockImplementation()` with `new`. - `GraphiQL.spec.tsx` "does not allow ... persisting headers" caps `findByText` at 1s. v2 won the race against the 9s `testTimeout`; v4 doesn't. - `graphql-language-service-server/vitest.config.mts`: replaced removed `poolOptions.threads.singleThread` with top-level `fileParallelism: false`.
|
These explained "v4 changed X" rather than describing current behavior.
This was referenced May 14, 2026
trevor-scheer
added a commit
that referenced
this pull request
May 14, 2026
## Summary Times out at the default 9s on every CI run since Vitest 4 landed (#4260). It's the only test in `GraphiQL.spec.tsx` that boots Monaco's `editorWorkerService` from a cold start; the rest get a warm worker. Vitest 4's pool switch from `threads` to `forks` pushed cold-boot just past 9s. Bumped to 20s on this one test, with an inline comment explaining why for the next person. Failed on two back-to-back runs of an unrelated PR: - https://github.com/graphql/graphiql/actions/runs/25878177678/job/76051305013 - https://github.com/graphql/graphiql/actions/runs/25878177678/job/76052552437
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.
Background
#4257 is adding a Storybook a11y CI gate to
@graphiql/react, currently via@storybook/test-runner+axe-playwright. The paved path Storybook recommends is@storybook/addon-vitest, which folds stories into the existing Vitest suite and avoids a separate workflow file, test-runner config, and JSON baseline. That addon requires Vitest ≥ 3; we're on^2.1.9workspace-wide, so this upgrade is a prerequisite for taking the cleaner approach in #4257 rather than landing cruft we'd immediately want to rip out.What this enables
Switching #4257 to:
@storybook/addon-vitest+@storybook/addon-a11yparameters.a11y.test: 'error' | 'todo' | 'off'— no JSON baseline file.storybook/test-runner.ts, noa11y-baseline.json, no@storybook/test-runner/axe-playwrightdevDepsChanges
Workspace-wide bump to Vitest v4 and its companion peer-deps. A few mocks needed light fixups for v4's stricter
newsemantics.