forked from zhuanggenhua/BoardGame
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.api.ts
More file actions
51 lines (49 loc) · 1.51 KB
/
Copy pathvitest.config.api.ts
File metadata and controls
51 lines (49 loc) · 1.51 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 { defineConfig } from 'vitest/config';
import path from 'path';
import { fileURLToPath } from 'url';
const workspaceRoot = fileURLToPath(new URL('.', import.meta.url));
const rootSetupFile = path.resolve(workspaceRoot, 'vitest.setup.ts');
const apiSetupFile = path.resolve(workspaceRoot, 'apps/api/test/vitest.setup.ts');
export default defineConfig({
server: {
fs: {
strict: false,
},
},
resolve: {
alias: {
'@locales': path.resolve(workspaceRoot, 'public/locales'),
},
},
esbuild: {
jsx: 'automatic',
jsxImportSource: 'react',
tsconfigRaw: {
compilerOptions: {
experimentalDecorators: true,
emitDecoratorMetadata: true,
},
},
},
test: {
globals: true,
environment: 'jsdom',
// API e2e/unit tests share Mongo and Nest app setup; run them in a single worker to avoid
// intermittent worker OOM / startup thrash during pre-push while keeping the full suite intact.
pool: 'threads',
fileParallelism: false,
maxWorkers: 1,
include: [
'apps/api/test/**/*.test.{ts,tsx}',
'apps/api/test/**/*.e2e-spec.ts',
],
exclude: [
'**/node_modules/**',
'**/dist/**',
'**/.{idea,git,cache,output,temp}/**',
],
testTimeout: 180000,
hookTimeout: 180000,
setupFiles: [rootSetupFile, apiSetupFile],
},
});