代码拉取完成,页面将自动刷新
import * as path from 'node:path';
import * as os from 'node:os';
import * as process from 'node:process';
import { defineConfig } from 'vitest/config';
import { fileURLToPath } from 'node:url';
const timeout = process.env.CI ? 50000 : 30000;
const __dir = path.dirname(fileURLToPath(import.meta.url));
const utilsPath = path.resolve(__dir, 'packages/e2e-tests/testUtils');
// too many threads cause vite-ssr tests to fail randomly, limit to at most 33%
const fractionOfAvailableThreads = (f: number) =>
Math.max(1, Math.floor((os.cpus()?.length || 1) * f));
const numThreads = fractionOfAvailableThreads(1 / 3);
// start with vitest default excludes
const exclude = [
'**/node_modules/**',
'**/dist/**',
'**/cypress/**',
'**/.{idea,git,cache,output,temp}/**'
];
export default defineConfig({
resolve: {
alias: {
'~utils': utilsPath
}
},
test: {
include: ['./packages/e2e-tests/**/*.spec.[tj]s'],
exclude,
setupFiles: ['./packages/e2e-tests/vitestSetup.ts'],
globalSetup: ['./packages/e2e-tests/vitestGlobalSetup.ts'],
testTimeout: timeout,
hookTimeout: timeout,
globals: true,
reporters: 'dot',
onConsoleLog(log) {
if (log.match(/experimental|jit engine|emitted file/i)) return false;
},
minThreads: numThreads,
maxThreads: numThreads
},
esbuild: {
target: 'node18'
}
});
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。