-
Notifications
You must be signed in to change notification settings - Fork 6
/
vitest.config.ts
59 lines (57 loc) · 2.25 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
/**
* NOTE: Vitest requires tsconfigPaths for source files and aliases for test files
*/
import { configDefaults, defineConfig } from 'vitest/config';
import tsconfigPaths from 'vite-tsconfig-paths'; // necessary for vite to resolve tsconfig paths in factory source files
export default defineConfig({
plugins: [tsconfigPaths()],
test: {
onConsoleLog: () => {},
environment: 'node',
include: ['src/**/*.test.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
coverage: {
reporter: ['html'],
include: ['src/**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
exclude: [
...configDefaults.exclude,
'src/**/*.config.{js,ts,jsx,tsx}',
'src/**/*.test.{js,ts,jsx,tsx}',
'**/conversion/**',
'**/examples/**',
'**/scratch/**',
'**/server/**',
'src/forge/**',
'**/types/**',
],
provider: 'v8',
thresholds: {
statements: 95,
functions: 95,
branches: 83,
lines: 95,
},
all: true,
},
},
resolve: {
// necessary for vitest to resolve tsconfig paths in test.ts files
alias: {
'@Generators': new URL('./src/assemblies/generators', import.meta.url).pathname,
'@Assemblies': new URL('./src/assemblies', import.meta.url).pathname,
'@Engines': new URL('./src/tests/engines', import.meta.url).pathname, // test engines
'@Validators': new URL('./src/validators', import.meta.url).pathname,
'@Constants': new URL('./src/constants', import.meta.url).pathname,
'@Functions': new URL('./src/functions', import.meta.url).pathname,
'@Fixtures': new URL('./src/fixtures', import.meta.url).pathname,
'@Acquire': new URL('./src/acquire', import.meta.url).pathname,
'@Helpers': new URL('./src/helpers', import.meta.url).pathname,
'@Global': new URL('./src/global', import.meta.url).pathname,
'@Mutate': new URL('./src/mutate', import.meta.url).pathname,
'@Server': new URL('./src/server', import.meta.url).pathname,
'@Query': new URL('./src/query', import.meta.url).pathname,
'@Tests': new URL('./src/tests', import.meta.url).pathname,
'@Tools': new URL('./src/tools', import.meta.url).pathname,
'@Types': new URL('./src/types', import.meta.url).pathname,
},
},
});