-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.ts
More file actions
48 lines (47 loc) · 1.19 KB
/
vitest.config.ts
File metadata and controls
48 lines (47 loc) · 1.19 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
import { defineConfig } from 'vitest/config';
import { createRequire } from 'module';
// forces the same CJS entrypoint for graphql
// without this, vitest had trouble resolving the graphql module
// in integration tests
const require = createRequire(import.meta.url);
const graphqlPath = require.resolve('graphql');
export default defineConfig({
test: {
globals: true,
environment: 'node',
reporters: ['default', 'junit'],
outputFile: {
junit: './coverage/junit.xml',
},
coverage: {
provider: 'v8',
reporter: ['text', 'html', 'json'],
reportsDirectory: './coverage',
include: ['src/**/*.ts'],
exclude: [
'src/**/*.test.ts',
'src/**/*.spec.ts',
'src/**/index.ts',
'src/generated/**/*.ts',
'node_modules',
'dist',
],
thresholds: {
lines: 90,
functions: 90,
branches: 90,
statements: 90,
},
},
setupFiles: ['./setupVitest.ts'],
include: ['src/**/__tests__/*.test.ts', 'src/__tests__/**/*.test.ts'],
testTimeout: 10000,
hookTimeout: 10000,
},
resolve: {
alias: {
'@app': '/src',
graphql: graphqlPath,
},
},
});