update
This commit is contained in:
26
vitest.config.ts
Normal file
26
vitest.config.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import { defineConfig } from 'vitest/config'
|
||||
import react from '@vitejs/plugin-react'
|
||||
import { resolve } from 'path'
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
resolve: {
|
||||
alias: {
|
||||
'@shared': resolve(__dirname, 'src/shared'),
|
||||
'@renderer': resolve(__dirname, 'src/renderer/src')
|
||||
}
|
||||
},
|
||||
test: {
|
||||
globals: true,
|
||||
environment: 'jsdom',
|
||||
setupFiles: ['./vitest.setup.ts'],
|
||||
include: ['src/**/*.{test,spec}.{ts,tsx}'],
|
||||
exclude: ['e2e/**', 'node_modules/**'],
|
||||
// 在中文路径 + 并行 worker + jsdom 下,Vite 的 NewSpace 在默认堆下
|
||||
// 会爆(FATAL ERROR: NewSpace::EnsureCurrentCapacity)。给 worker 加大堆
|
||||
// 是最稳的修法。设 4GB 给 worker 留 1GB 给主进程,够 7 个测用例通过。
|
||||
env: {
|
||||
NODE_OPTIONS: '--max-old-space-size=4096'
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user