2022-06-19 19:59:52 +00:00
|
|
|
import { resolve } from 'node:path'
|
2022-05-11 06:33:20 +00:00
|
|
|
import { defineConfig } from 'vitest/config'
|
|
|
|
|
2022-05-11 14:23:27 +00:00
|
|
|
const timeout = process.env.CI ? 50000 : 30000
|
|
|
|
|
2022-05-11 06:33:20 +00:00
|
|
|
export default defineConfig({
|
2022-05-11 09:03:19 +00:00
|
|
|
resolve: {
|
|
|
|
alias: {
|
|
|
|
'~utils': resolve(__dirname, './playground/test-utils'),
|
|
|
|
},
|
|
|
|
},
|
2022-05-11 06:33:20 +00:00
|
|
|
test: {
|
|
|
|
include: ['./playground/**/*.spec.[tj]s'],
|
2022-05-11 10:09:52 +00:00
|
|
|
setupFiles: ['./playground/vitestSetup.ts'],
|
|
|
|
globalSetup: ['./playground/vitestGlobalSetup.ts'],
|
2022-05-11 14:23:27 +00:00
|
|
|
testTimeout: timeout,
|
|
|
|
hookTimeout: timeout,
|
2022-05-11 06:33:20 +00:00
|
|
|
reporters: 'dot',
|
2023-06-08 09:56:21 +00:00
|
|
|
deps: {
|
|
|
|
// Prevent Vitest from running the workspace packages in Vite's SSR runtime
|
|
|
|
moduleDirectories: ['node_modules', 'packages'],
|
|
|
|
},
|
2022-05-11 06:33:20 +00:00
|
|
|
onConsoleLog(log) {
|
2023-09-21 09:01:16 +00:00
|
|
|
if (
|
|
|
|
log.match(
|
|
|
|
/experimental|jit engine|emitted file|tailwind|The CJS build of Vite/i,
|
|
|
|
)
|
|
|
|
)
|
2022-05-11 06:33:20 +00:00
|
|
|
return false
|
2022-05-17 14:33:44 +00:00
|
|
|
},
|
2022-05-11 06:33:20 +00:00
|
|
|
},
|
|
|
|
esbuild: {
|
2023-08-15 13:28:17 +00:00
|
|
|
target: 'node18',
|
2022-05-11 06:33:20 +00:00
|
|
|
},
|
|
|
|
})
|