-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathvitest.config.ts
More file actions
19 lines (18 loc) · 882 Bytes
/
Copy pathvitest.config.ts
File metadata and controls
19 lines (18 loc) · 882 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { fileURLToPath } from 'node:url';
import { defineConfig } from 'vitest/config';
export default defineConfig({
// Mirror tsconfig's `@/*` path so panel components are importable in tests.
resolve: { alias: { '@': fileURLToPath(new URL('.', import.meta.url)) } },
// Next's tsconfig sets `jsx: preserve` (Next compiles JSX itself); the
// vitest transform must compile it instead for the React-facing suites.
oxc: { jsx: { runtime: 'automatic' } },
test: {
// Most modules under test are React-free and Three.js-free pure logic, so
// the fast Node environment is the default. The few React-facing suites
// (e.g. use-layout-store.react.test.ts) opt into jsdom per-file via a
// `// @vitest-environment jsdom` comment.
environment: 'node',
globals: false,
include: ['app/**/*.test.{ts,tsx}', 'components/**/*.test.{ts,tsx}'],
},
});