@@ -256,7 +256,15 @@ export interface TestPresetPrivate {
256256 __generator ?: string ; // Getting this from the config preset
257257}
258258
259- export interface TestPreset extends api . TestPreset , TestPresetPrivate , PresetPrivate { }
259+ // v11+: execution.jobs can be an empty string (--parallel with no value).
260+ // Widen the type from the API's number to number | string.
261+ export interface TestExecutionOptions extends Omit < api . ExecutionOptions , 'jobs' > {
262+ jobs ?: number | string ;
263+ }
264+
265+ export interface TestPreset extends Omit < api . TestPreset , 'execution' > , TestPresetPrivate , PresetPrivate {
266+ execution ?: TestExecutionOptions ;
267+ }
260268
261269export interface PackagePresetPrivate {
262270 __binaryDir ?: string ; // Getting this from the config preset
@@ -2299,12 +2307,10 @@ export function testArgs(preset: TestPreset): string[] {
22992307 preset . execution . enableFailover && result . push ( '-F' ) ;
23002308 if ( preset . execution . jobs !== undefined ) {
23012309 // v11+: jobs can be an empty string meaning --parallel with no value (auto-detect).
2302- // The API type says number, but JSON parsing may produce a string at runtime.
2303- const jobsValue = preset . execution . jobs as number | string ;
2304- if ( typeof jobsValue === 'string' && jobsValue . length === 0 ) {
2310+ if ( preset . execution . jobs === '' ) {
23052311 result . push ( '--parallel' ) ;
23062312 } else {
2307- result . push ( '--parallel' , jobsValue . toString ( ) ) ;
2313+ result . push ( '--parallel' , preset . execution . jobs . toString ( ) ) ;
23082314 }
23092315 }
23102316 preset . execution . resourceSpecFile && result . push ( '--resource-spec-file' , preset . execution . resourceSpecFile ) ;
0 commit comments