Skip to content

Commit 7fe2b66

Browse files
committed
test: align GraphQL resolution for Vitest 4
1 parent dbfd437 commit 7fe2b66

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

vitest.config.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
1+
import { createRequire } from 'node:module';
12
import { defineConfig } from 'vitest/config';
23

4+
const require = createRequire(import.meta.url);
5+
36
export default defineConfig({
7+
resolve: {
8+
alias: {
9+
graphql: require.resolve('graphql/index.js'),
10+
},
11+
},
412
test: {
513
globals: true,
614
environment: 'node',
@@ -9,6 +17,7 @@ export default defineConfig({
917
exclude: ['node_modules', 'dist', 'example', '.idea', '.git', '.cache', '.github'],
1018
server: {
1119
deps: {
20+
external: ['graphql'],
1221
fallbackCJS: true,
1322
},
1423
},

0 commit comments

Comments
 (0)