-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathvitest.config.ts
More file actions
51 lines (49 loc) · 1.26 KB
/
vitest.config.ts
File metadata and controls
51 lines (49 loc) · 1.26 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
40
41
42
43
44
45
46
47
48
49
50
51
import { fileURLToPath } from 'node:url';
import react from '@vitejs/plugin-react';
import { preview } from '@vitest/browser-preview';
import { defineConfig } from 'vitest/config';
const setupFile = fileURLToPath(new URL('./tests/setup.ts', import.meta.url));
const commonExclude = [
'**/node_modules/**',
'**/dist/**',
'**/.turbo/**',
];
export default defineConfig({
plugins: [react()],
test: {
projects: [
{
test: {
name: 'unit',
globals: true,
environment: 'jsdom',
setupFiles: [setupFile],
include: [
'packages/**/__tests__/**/*.{test,spec}.{ts,tsx}',
'tests/**/*.{test,spec}.{ts,tsx}',
],
exclude: [
...commonExclude,
'tests/browser/**/*',
'tests/**/*.browser.{test,spec}.{ts,tsx}',
],
},
},
{
test: {
name: 'browser',
globals: true,
include: [
'tests/browser/**/*.{test,spec}.{ts,tsx}',
'tests/**/*.browser.{test,spec}.{ts,tsx}',
],
exclude: [...commonExclude],
browser: {
provider: preview(),
instances: [{ browser: 'chromium' }],
},
},
},
],
},
});