-
Notifications
You must be signed in to change notification settings - Fork 48
Expand file tree
/
Copy pathvitest.config.js
More file actions
39 lines (38 loc) · 1.33 KB
/
vitest.config.js
File metadata and controls
39 lines (38 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import { defineConfig } from 'vitest/config';
import react from '@vitejs/plugin-react';
import path from 'path';
export default defineConfig({
plugins: [react()],
test: {
environment: 'jsdom',
globals: true,
setupFiles: [],
// Automatically reset env-var mutations between tests so `vi.stubEnv`
// or direct `process.env.X = ...` writes in one test do not leak into
// the next. Many existing tests set env vars without a matching
// afterEach restore — `unstubEnvs: true` provides the guardrail while
// those test files are gradually migrated to vi.stubEnv.
unstubEnvs: true,
// Exclude Playwright specs (tests/) — they use @playwright/test, not vitest.
// Also skip the Playwright defaults, Vitest's own build outputs, and the
// CLI's node:test suite under cli/test/ (run separately by `npm test -w
// @dashclaw/cli` or `cli && npm test`).
exclude: [
'**/node_modules/**',
'**/dist/**',
'**/.next/**',
'**/tests/**',
'**/playwright-report/**',
'**/test-results/**',
'cli/test/**',
// Git worktrees may hold sibling-branch copies of the test suite with
// their own divergent state; vitest should never walk into them.
'.worktrees/**',
],
},
resolve: {
alias: {
'@': path.resolve(__dirname, './app'),
},
},
});