[READ-ONLY] Mirror of https://github.com/vitest-dev/vitest. Next generation testing framework powered by Vite. vitest.dev
test testing-tools vite
12

Configure Feed

Select the types of activity you want to include in your feed.

test: reduce max thread count when vitest-in-vitest (#7829)

authored by

Ari Perkkiö and committed by
GitHub
(Apr 14, 2025, 7:58 AM +0300) 3fa7b78c 41286655

+10 -1
+10 -1
test/test-utils/index.ts
··· 83 83 NO_COLOR: 'true', 84 84 ...rest.env, 85 85 }, 86 + 87 + // Test cases are already run with multiple forks/threads 88 + maxWorkers: 1, 89 + minWorkers: 1, 86 90 }, { 87 91 ...viteOverrides, 88 92 server: { ··· 147 151 earlyReturn?: boolean 148 152 } 149 153 150 - export async function runCli(command: string, _options?: CliOptions | string, ...args: string[]) { 154 + async function runCli(command: 'vitest' | 'vite-node', _options?: CliOptions | string, ...args: string[]) { 151 155 let options = _options 152 156 153 157 if (typeof _options === 'string') { 154 158 args.unshift(_options) 155 159 options = undefined 160 + } 161 + 162 + if (command === 'vitest') { 163 + args.push('--maxWorkers=1') 164 + args.push('--minWorkers=1') 156 165 } 157 166 158 167 const subprocess = x(command, args, options as Options).process!