-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathvitest.config.ts
More file actions
54 lines (53 loc) · 2.01 KB
/
vitest.config.ts
File metadata and controls
54 lines (53 loc) · 2.01 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
import swc from "unplugin-swc"; // https://github.com/inversify/monorepo/issues/1378
import { defineConfig } from 'vitest/config'
export default defineConfig({
plugins: [
// Vite plugin
swc.vite(),
],
test: {
projects: [
// you can use a list of glob patterns to define your projects
// Vitest expects a list of config files
// or directories where there is a config file
//'packages/*',
//'tests/*/vitest.config.{e2e,unit}.ts',
// you can even run the same tests,
// but with different configs in the same "vitest" process
{
test: {
name: 'UnitTests',
root: './tests/UnitTests',
environment: 'node',
//setupFiles: ['./setup.happy-dom.ts'],
globals: true,
include: ['*.{js,tsx,ts}'],
clearMocks: true // Automatically calls vi.clearAllMocks() before each test
},
},
{
test: {
name: 'UseCaseTests',
root: './tests/UseCaseTests',
environment: 'node',
//setupFiles: ['./setup.node.ts'],
globals: true,
include: ['*.{js,tsx,ts}'],
clearMocks: true // Automatically calls vi.clearAllMocks() before each test
},
},
{
test: {
name: 'IntegrationTests',
root: './tests/IntegrationTests',
environment: 'node',
//setupFiles: ['./IntegrationTestSetup.ts'],
globals: true,
include: ['*.{js,tsx,ts}'],
//exclude: ['./IntegrationTestSetup.ts'],
clearMocks: true // Automatically calls vi.clearAllMocks() before each test
},
},
],
},
})