File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -83,6 +83,10 @@ export async function runVitest(
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,14 +151,19 @@ interface CliOptions extends Partial<Options> {
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
156
160
}
157
161
162
+ if ( command === 'vitest' ) {
163
+ args . push ( '--maxWorkers=1' )
164
+ args . push ( '--minWorkers=1' )
165
+ }
166
+
158
167
const subprocess = x ( command , args , options as Options ) . process !
159
168
const cli = new Cli ( {
160
169
stdin : subprocess . stdin ! ,
You can’t perform that action at this time.
0 commit comments