Commit 5af591c
authored
chore: upgrade vitest and @vitest/ui to 4.1.2 (#16154)
## Summary
- Bump `vitest` from 4.0.15 to 4.1.2 (root + test/)
- Bump `@vitest/ui` from 4.0.15 to 4.1.2 (root)
- Fix `graphql` module alias in `vitest.config.ts` for compatibility
with Vitest 4.1's new module runner
### graphql alias fix
Vitest 4.1 replaced the default SSR environment runner with a new Vite
module runner that loads "inlined" modules in its own context and
"external" modules via Node's native import. This caused the `graphql`
package to be loaded twice (two separate module instances), breaking all
`instanceof` checks (e.g. `isScalarType`, `new GraphQLList`).
The previous alias (`graphql: 'node_modules/graphql/index.js'`) also no
longer worked because pnpm's isolated linker doesn't hoist `graphql` to
root `node_modules/`.
Fix: use `createRequire` to resolve the actual `graphql` location from
`packages/graphql/` (where it's a direct dependency), then use
regex-based aliases to handle both the main import and subpath imports
(e.g. `graphql/execution/values.js`), pointing the main import to the
CJS entry (`index.js`) to ensure a single module identity.
This unlocks native test tags support (`--tags-filter` CLI) which will
be used in a follow-up PR to tag tests by feature category (GIS,
transactions, migrations, etc.).
## Test plan
- [ ] CI passes (all existing integration tests should continue to work
unchanged)
- Verified locally: `auth`, `collections-graphql`, `collections-rest`,
`fields`, `database` suites all pass
---------
Co-authored-by: German Jablonski <GermanJablo@users.noreply.github.com>1 parent b13c5c9 commit 5af591c
4 files changed
Lines changed: 1804 additions & 1968 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
200 | | - | |
| 200 | + | |
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
| |||
240 | 240 | | |
241 | 241 | | |
242 | 242 | | |
243 | | - | |
| 243 | + | |
244 | 244 | | |
245 | 245 | | |
246 | 246 | | |
| |||
0 commit comments