-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
vitest.config.ts
62 lines (60 loc) · 1.39 KB
/
vitest.config.ts
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
import { defineConfig } from 'vitest/config'
import { fileURLToPath } from 'node:url'
export default defineConfig({
define: {
__DEV__: true,
__TEST__: true,
__BROWSER__: true,
__USE_DEVTOOLS__: false,
},
resolve: {
alias: [
{
find: /^@pinia\/(.*?)$/,
replacement: fileURLToPath(
new URL('./packages/packages/$1/src', import.meta.url)
),
},
{
find: /^pinia$/,
replacement: fileURLToPath(
new URL('./packages/pinia/src', import.meta.url)
),
},
],
},
test: {
include: ['src/**/*.{test,spec}.ts', '__tests__/**/*.{test,spec}.ts'],
setupFiles: [
fileURLToPath(
new URL('./packages/pinia/__tests__/vitest-setup.ts', import.meta.url)
),
],
environment: 'happy-dom',
fakeTimers: {
// easier to read, some date in 2001
now: 1_000_000_000_000,
},
typecheck: {
enabled: true,
},
coverage: {
enabled: true,
provider: 'v8',
reporter: ['text', 'lcovonly', 'html'],
all: true,
include: [
'packages/pinia/src',
'packages/nuxt/src',
'packages/testing/src',
],
exclude: [
'**/src/index.ts',
'**/*.test-d.ts',
'packages/pinia/src/devtools',
'packages/pinia/src/vue2-plugin.ts',
'packages/pinia/src/hmr.ts',
],
},
},
})