-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.ts
More file actions
70 lines (63 loc) · 3.7 KB
/
vitest.config.ts
File metadata and controls
70 lines (63 loc) · 3.7 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*
███████████████████████████████████████████████████████████████████████████████
██******************** PRESENTED BY t33n Software ***************************██
██ ██
██ ████████╗██████╗ ██████╗ ███╗ ██╗ ██
██ ╚══██╔══╝╚════██╗╚════██╗████╗ ██║ ██
██ ██║ █████╔╝ █████╔╝██╔██╗ ██║ ██
██ ██║ ╚═══██╗ ╚═══██╗██║╚██╗██║ ██
██ ██║ ██████╔╝██████╔╝██║ ╚████║ ██
██ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═══╝ ██
██ ██
███████████████████████████████████████████████████████████████████████████████
███████████████████████████████████████████████████████████████████████████████
*/
// 🌐 Import dotenv to load environment variables from .env files
import dotenv from 'dotenv'
// 🔧 Load the default environment variables from the .env file
dotenv.config()
// 🔄 Load the test environment variables from .env.test and override defaults
dotenv.config({ path: '.env.test', override: true })
// === DEPENDENCIES ===
// 📦 Import tsconfigPaths for TypeScript path resolution
import tsconfigPaths from 'vite-tsconfig-paths'
// 🔍 Import defineConfig from vitest/config to define Vitest configuration
import { defineConfig } from 'vitest/config'
/**
* Represents the configuration for the Vitest test runner.
* @returns {import('vitest/config').UserConfig} The Vitest configuration object.
*/
export default defineConfig({
// ⚙️ Plugins to be used in the Vitest configuration
plugins: [tsconfigPaths()],
test: {
// 🔍 Disable watch mode during testing
watch: false,
// 📝 Specify the setup file to run before each test
setupFiles: 'test/unit/pretestEach.ts',
// 📚 globalSetup: 'test/pretestAll.ts', // Uncomment if needed
// 🌐 Set the testing environment to Node
environment: 'node',
typecheck: {
// 🔍 Specify files to include for type checking
include: ['**/*.{test,spec}.?(c|m)[jt]s?(x)']
},
coverage: {
/**
* Specifies the directories to include for coverage.
* @type {string[]}
*/
include: ['src/'],
/**
* Specifies the files or directories to exclude from coverage.
* @type {string[]}
*/
// exclude: ['src/legacy/', 'utils/helpers.ts'], // Uncomment if needed
/**
* Specifies the coverage reporters to use.
* @type {string[]}
*/
reporter: ['text', 'json', 'html']
}
}
})