generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathvitest.config.ts
More file actions
93 lines (91 loc) · 2.2 KB
/
vitest.config.ts
File metadata and controls
93 lines (91 loc) · 2.2 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import * as fs from 'fs';
import * as path from 'path';
import { defineConfig } from 'vitest/config';
/**
* Shared text-loader plugin for loading markdown and llm-compacted files as text
*/
const textLoaderPlugin = {
name: 'text-loader',
transform(code: string, id: string) {
if (id.includes('llm-compacted') && id.endsWith('.ts')) {
const text = fs.readFileSync(id, 'utf-8');
return {
code: `export default ${JSON.stringify(text)};`,
map: null,
};
}
if (id.endsWith('.md')) {
const text = fs.readFileSync(id, 'utf-8');
return {
code: `export default ${JSON.stringify(text)};`,
map: null,
};
}
},
};
export default defineConfig({
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
plugins: [textLoaderPlugin],
test: {
projects: [
{
extends: true,
test: {
name: 'unit',
include: ['src/**/*.test.ts', 'src/**/*.test.tsx'],
exclude: ['src/assets/cdk/test/*.test.ts'],
},
},
{
extends: true,
test: {
name: 'integ',
include: ['integ-tests/**/*.test.ts'],
exclude: ['integ-tests/tui/**/*.test.ts'],
},
},
{
extends: true,
test: {
name: 'e2e',
include: ['e2e-tests/**/*.test.ts'],
testTimeout: 600000,
hookTimeout: 600000,
},
},
{
extends: true,
test: {
name: 'tui',
include: ['integ-tests/tui/**/*.test.ts'],
testTimeout: 30_000,
fileParallelism: false,
setupFiles: ['./integ-tests/tui/setup.ts'],
},
},
],
testTimeout: 120000,
hookTimeout: 120000,
globals: false,
reporters: ['verbose'],
coverage: {
provider: 'v8',
reporter: ['text', 'text-summary', 'json', 'json-summary', 'html', 'lcov'],
reportsDirectory: './coverage',
reportOnFailure: true,
include: ['src/**/*.ts'],
exclude: [
'src/**/*.test.ts',
'src/**/__tests__/**',
'src/assets/**',
'src/test-utils/**',
'src/**/*.d.ts',
'**/index.ts',
],
},
},
});