-
-
Notifications
You must be signed in to change notification settings - Fork 71
Expand file tree
/
Copy pathvitest.config.ts
More file actions
67 lines (66 loc) · 1.84 KB
/
Copy pathvitest.config.ts
File metadata and controls
67 lines (66 loc) · 1.84 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import { defineConfig } from 'vitest/config';
import react from '@vitejs/plugin-react';
import path from 'path';
export default defineConfig({
plugins: [react()],
test: {
globals: true,
environment: 'node', // Default to node, tests can override with @vitest-environment
setupFiles: './src/test/setup.ts',
isolate: true,
testTimeout: 10000,
hookTimeout: 10000,
// Run tests serially to avoid OOM issues
fileParallelism: false,
pool: 'forks',
poolOptions: {
forks: {
singleFork: true,
},
},
exclude: [
'**/node_modules/**',
'**/dist/**',
'**/.paperclip/**',
],
env: {
DATABASE_PATH: ':memory:',
},
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html'],
exclude: [
'node_modules/',
'src/test/',
'*.config.ts',
'**/*.d.ts',
'**/*.test.ts',
'**/*.test.tsx'
],
thresholds: {
statements: 32,
'src/utils/**': {
statements: 70,
},
'src/server/**': {
statements: 25,
},
}
}
},
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
// Force the ESM build of the spiderfier under Vitest. Its package `main`
// is a UMD bundle whose named `OverlappingMarkerSpiderfier` export isn't a
// constructor when Vitest externalizes it, so any test that mounts a
// spiderfier-using map component (e.g. MeshCoreSourcePage → MeshCoreMap)
// throws "OverlappingMarkerSpiderfier is not a constructor". The `module`
// (ESM) entry exports the real class. App build (vite.config) is unaffected.
'ts-overlapping-marker-spiderfier-leaflet': path.resolve(
__dirname,
'node_modules/ts-overlapping-marker-spiderfier-leaflet/dist/omsleaflet.js',
),
}
}
});