-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvitest.config.ts
More file actions
53 lines (48 loc) · 1.2 KB
/
vitest.config.ts
File metadata and controls
53 lines (48 loc) · 1.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
/**
* Vitest Configuration
*
* Configuration for the test suite. Vitest is a unit testing framework
* that's optimized for Vite projects and TypeScript.
*
* This config sets up:
* - TypeScript support
* - Test file patterns
* - Coverage reporting
* - Mock utilities
*/
import { defineConfig } from 'vitest/config';
import path from 'path';
export default defineConfig({
test: {
// Environment for running tests
// Node environment simulates a server environment
environment: 'node',
// Test file patterns to discover
// Includes both .test.ts and .spec.ts files
include: ['tests/**/*.{test,spec}.ts'],
// TypeScript support for test files
// Automatically transpiles .ts test files
globals: true,
// Coverage configuration
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html'],
include: ['src/**/*.ts'],
exclude: [
'src/**/*.test.ts',
'src/**/*.spec.ts',
'src/**/index.ts',
],
// Thresholds for coverage requirements
lines: 80,
functions: 80,
branches: 75,
statements: 80,
},
},
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
});