-
Notifications
You must be signed in to change notification settings - Fork 5
/
vitest.config.ts
68 lines (65 loc) · 1.42 KB
/
vitest.config.ts
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
import ts from 'typescript';
import { mergeConfig } from 'vite';
import { vitePluginTypescriptTransform } from 'vite-plugin-typescript-transform';
import { defaultExclude, defaultInclude, defineConfig } from 'vitest/config';
import viteConfiguration from './vite.config.js';
const vitestConfiguration = defineConfig({
plugins: [
vitePluginTypescriptTransform({
enforce: 'pre',
filter: {
files: {
include: /\.ts$/,
},
},
tsconfig: {
override: {
target: ts.ScriptTarget.ES2021,
},
},
}),
],
test: {
allowOnly: true,
coverage: {
all: true,
clean: true,
cleanOnRerun: true,
provider: 'v8',
reportsDirectory: '.coverage',
watermarks: {
statements: [90, 100],
branches: [90, 100],
functions: [90, 100],
lines: [90, 100],
},
},
deps: {
optimizer: {
web: {
enabled: true,
},
ssr: {
enabled: true,
},
},
},
environment: 'jsdom',
globals: false,
include: defaultInclude.map(include => `test/${include}`),
exclude: [
...defaultExclude,
'test/manual/**',
],
isolate: true,
passWithNoTests: false,
reporters: 'verbose',
setupFiles: [
'./test/setup/configuration.ts',
],
},
});
export default mergeConfig(
viteConfiguration,
vitestConfiguration,
);