forked from vitejs/vite
-
Notifications
You must be signed in to change notification settings - Fork 2
/
vitest.config.e2e.ts
49 lines (46 loc) · 1.43 KB
/
vitest.config.e2e.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
import { resolve } from 'node:path'
import { defaultExclude, defineConfig } from 'vitest/config'
const isBuild = !!process.env.VITE_TEST_BUILD
const timeout = process.env.PWDEBUG ? Infinity : process.env.CI ? 50000 : 30000
export default defineConfig({
resolve: {
alias: {
'~utils': resolve(__dirname, './playground/test-utils'),
},
},
test: {
include: ['./playground/**/*.spec.[tj]s'],
exclude: [
'./playground/legacy/**/*.spec.[tj]s', // system format
...(isBuild
? [
'./playground/object-hooks/**/*.spec.[tj]s', // object hook sequential
'./playground/optimize-deps/**/*.spec.[tj]s', // https://github.com/rolldown/rolldown/issues/2031
'./playground/tsconfig-json/__tests__/**/*.spec.[tj]s', // decorators is not supported by oxc
]
: []),
...defaultExclude,
],
setupFiles: ['./playground/vitestSetup.ts'],
globalSetup: ['./playground/vitestGlobalSetup.ts'],
testTimeout: timeout,
hookTimeout: timeout,
reporters: 'dot',
deps: {
// Prevent Vitest from running the workspace packages in Vite's SSR runtime
moduleDirectories: ['node_modules', 'packages'],
},
onConsoleLog(log) {
if (
log.match(
/experimental|jit engine|emitted file|tailwind|The CJS build of Vite/i,
)
)
return false
},
},
esbuild: {
target: 'node18',
},
publicDir: false,
})