-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.ts
More file actions
53 lines (51 loc) · 1.23 KB
/
vitest.config.ts
File metadata and controls
53 lines (51 loc) · 1.23 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
import { defineConfig } from 'vitest/config'
import { fileURLToPath } from 'node:url'
import { dirname, resolve } from 'node:path'
const _dirname = dirname(fileURLToPath(import.meta.url))
const alias = [
{ find: '~', replacement: resolve(_dirname, 'app') },
{ find: '~~', replacement: _dirname },
]
export default defineConfig({
test: {
coverage: {
provider: 'v8',
reporter: ['text', 'html', 'clover', 'json'],
reportsDirectory: './coverage',
all: false,
},
projects: [
{
resolve: { alias },
test: {
name: 'node',
include: [
'src/**/*.{test,spec}.ts',
'test/node/**/*.{test,spec}.ts',
],
environment: 'node',
},
},
{
resolve: { alias },
test: {
name: 'e2e',
include: [
'test/e2e/**/*.{test,spec}.ts',
],
environment: 'node',
setupFiles: ['./test/e2e/setup.ts'],
},
},
{
resolve: { alias },
test: {
name: 'browser',
include: ['test/browser/**/*.{test,spec}.ts'],
environment: 'node',
setupFiles: ['./test/browser/setup.ts'],
},
},
],
},
})