-
Notifications
You must be signed in to change notification settings - Fork 54
Expand file tree
/
Copy pathvitest.config.ts
More file actions
37 lines (36 loc) · 1.11 KB
/
vitest.config.ts
File metadata and controls
37 lines (36 loc) · 1.11 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
import { defineConfig } from 'vitest/config';
import path from 'path';
export default defineConfig({
resolve: {
alias: [
// Must come before the general '@' alias to avoid @/ matching first
{ find: '@/generated/prisma/client', replacement: path.resolve(__dirname, './src/__mocks__/prisma-client.ts') },
{ find: '@', replacement: path.resolve(__dirname, './src') },
],
},
test: {
reporters: process.env.GITHUB_ACTIONS === 'true' ? ['default', 'github-actions'] : ['default'],
globals: true,
environment: 'node',
include: ['src/**/__tests__/**/*.test.ts'],
exclude: ['node_modules', '.next', 'packages'],
coverage: {
provider: 'v8',
reporter: ['text', 'html', 'lcov', 'json', 'json-summary'],
include: ['src/services/**/*.ts', 'src/lib/**/*.ts'],
exclude: [
'src/**/__tests__/**',
'src/**/__mocks__/**',
'src/**/__test-utils__/**',
'src/lib/prisma.ts',
'src/lib/redis.ts',
],
thresholds: {
lines: 95,
statements: 95,
branches: 85,
functions: 93,
},
},
},
});