Skip to content

Commit b41e7fd

Browse files
committed
refactor: use workspace instead of environmentMatchGlobs in vitest, which is now deprecated
1 parent a6a3583 commit b41e7fd

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

vitest.config.mts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,15 @@ export default defineConfig({
1212
include: ['src/**/*'],
1313
exclude: ['src/**/*.stories.{js,jsx,ts,tsx}', '**/*.d.ts'],
1414
},
15-
environmentMatchGlobs: [
16-
['**/*.test.tsx', 'jsdom'],
17-
['src/hooks/**/*.test.ts', 'jsdom'],
15+
workspace: [
16+
{
17+
extends: true, // Inherit root config (plugins, globals, coverage, setupFiles, env)
18+
test: {
19+
include: ['**/*.test.tsx', 'src/hooks/**/*.test.ts'],
20+
environment: 'jsdom',
21+
name: 'jsdom',
22+
},
23+
},
1824
],
1925
setupFiles: ['./vitest-setup.ts'],
2026
env: loadEnv('', process.cwd(), ''),

0 commit comments

Comments
 (0)