-
Notifications
You must be signed in to change notification settings - Fork 0
/
vitest.workspace.ts
45 lines (43 loc) · 999 Bytes
/
vitest.workspace.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
import { join } from 'node:path'
import { defineConfig, defineWorkspace, mergeConfig } from 'vitest/config'
import viteConfig from './vite.config'
const alias = {
'hook-di': join(__dirname, `src/index.ts`),
'hook-di/vue': join(__dirname, `src/vue.ts`),
}
export default defineWorkspace([
defineConfig((configEnv) => {
return mergeConfig(viteConfig(configEnv), {
test: {
include: ['**/__tests__/*.browser.test.{ts,js}'],
name: 'browser',
environment: 'jsdom',
},
resolve: {
alias: {
...alias,
},
},
})
}),
defineConfig((configEnv) => {
return mergeConfig(
viteConfig({
...configEnv,
isSsrBuild: true,
}),
defineConfig({
test: {
include: ['**/__tests__/*.node.test.{ts,js}'],
name: 'node',
environment: 'node',
},
resolve: {
alias: {
...alias,
},
},
}),
)
}),
])