-
Notifications
You must be signed in to change notification settings - Fork 197
Expand file tree
/
Copy pathvitest.config.mts
More file actions
85 lines (84 loc) · 2.62 KB
/
Copy pathvitest.config.mts
File metadata and controls
85 lines (84 loc) · 2.62 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import path from 'node:path'
import { loadEnv } from 'vite'
import tsconfigPaths from 'vite-tsconfig-paths'
import { defineConfig } from 'vitest/config'
// eslint-disable-next-line import/no-default-export
export default defineConfig({
plugins: [tsconfigPaths()],
test: {
projects: [
{
extends: true,
test: {
name: 'web',
environment: 'happy-dom',
setupFiles: ['src/setupVitest'],
clearMocks: true,
include: ['src/**/*.test.ts', 'src/**/*.test.tsx'],
exclude: [
// Temporarily skipped until https://github.com/shapeshift/hdwallet/pull/666 goes in
'src/components/Modals/Send/hooks/useSendDetails/useSendDetails.test.tsx',
'src/components/Modals/Send/hooks/useFormSend/useFormSend.test.tsx',
],
},
},
{
extends: true,
test: {
name: 'packages',
setupFiles: ['src/setupVitest'],
clearMocks: true,
include: ['packages/**/*.test.ts'],
exclude: [
'**/node_modules/**',
'packages/hdwallet-*/**',
'packages/public-api/src/integration.test.ts',
// tested via its own localized config (swap-widget project)
'packages/swap-widget/**',
],
},
},
'./packages/swap-widget/vitest.config.ts',
{
extends: true,
resolve: {
alias: {
mswMock: path.resolve(__dirname, 'packages/hdwallet-native/__mocks__/mswMock.ts'),
untouchableMock: path.resolve(
__dirname,
'packages/hdwallet-native/__mocks__/untouchableMock.ts',
),
'@ton/ton': path.resolve(__dirname, 'packages/hdwallet-native/__mocks__/@ton/ton.js'),
},
},
test: {
name: 'hdwallet',
globals: true,
include: ['packages/hdwallet-*/src/**/*.test.ts'],
exclude: ['packages/hdwallet-integration/**'],
setupFiles: ['fake-indexeddb/auto'],
testTimeout: 60_000,
clearMocks: true,
},
},
{
extends: true,
test: {
name: 'hdwallet-integration',
globals: true,
include: ['packages/hdwallet-integration/src/**/*.test.ts'],
testTimeout: 120_000,
},
},
{
extends: true,
test: {
name: 'public-api-integration',
env: loadEnv('test', path.resolve(__dirname, 'packages/public-api'), ''),
include: ['packages/public-api/src/integration.test.ts'],
testTimeout: 30_000,
},
},
],
},
})