forked from mydraft-cc/ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.ts
More file actions
39 lines (32 loc) · 1007 Bytes
/
vitest.config.ts
File metadata and controls
39 lines (32 loc) · 1007 Bytes
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 path from 'path';
import { defineConfig } from 'vite';
const isCI = !!process.env.CI || process.argv.includes('--coverage');
// https://vitejs.dev/config/
export default defineConfig({
resolve: {
alias: {
'@app': path.resolve(__dirname, './src/'),
},
},
test: {
globals: true,
// Use jsdom for CI, browser for local development
environment: isCI ? 'jsdom' : 'browser',
// Browser configuration for local tests
browser: {
enabled: !isCI,
// Update to use instances array instead of deprecated name field
instances: [
{ browser: 'chrome' }
],
// Fixes a bug with build errors in browser mode
slowHijackESM: false,
},
coverage: {
provider: 'istanbul',
},
// Increase timeouts for tests
testTimeout: 30000,
hookTimeout: 30000,
},
} as any);