File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -83,6 +83,10 @@ export async function runVitest(
8383 NO_COLOR : 'true' ,
8484 ...rest . env ,
8585 } ,
86+
87+ // Test cases are already run with multiple forks/threads
88+ maxWorkers : 1 ,
89+ minWorkers : 1 ,
8690 } , {
8791 ...viteOverrides ,
8892 server : {
@@ -147,14 +151,19 @@ interface CliOptions extends Partial<Options> {
147151 earlyReturn ?: boolean
148152}
149153
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 [ ] ) {
151155 let options = _options
152156
153157 if ( typeof _options === 'string' ) {
154158 args . unshift ( _options )
155159 options = undefined
156160 }
157161
162+ if ( command === 'vitest' ) {
163+ args . push ( '--maxWorkers=1' )
164+ args . push ( '--minWorkers=1' )
165+ }
166+
158167 const subprocess = x ( command , args , options as Options ) . process !
159168 const cli = new Cli ( {
160169 stdin : subprocess . stdin ! ,
You can’t perform that action at this time.
0 commit comments