File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -184,10 +184,7 @@ async function captureAppleRunnerSnapshot(
184184 ) ,
185185 ) ;
186186 const nodes = result . nodes ?? [ ] ;
187- const isValidEmptyScope =
188- normalizeSnapshotScope ( options ?. scope ) !== null &&
189- result . quality !== undefined &&
190- result . quality . state !== 'sparse' ;
187+ const isValidEmptyScope = acceptsEmptyScopedSnapshot ( options , result . quality ) ;
191188 if ( nodes . length === 0 && device . kind === 'simulator' && ! isValidEmptyScope ) {
192189 throw new AppError ( 'COMMAND_FAILED' , 'XCTest snapshot returned 0 nodes on iOS simulator.' ) ;
193190 }
@@ -201,6 +198,15 @@ async function captureAppleRunnerSnapshot(
201198 } ;
202199}
203200
201+ function acceptsEmptyScopedSnapshot (
202+ options : SnapshotOptions | undefined ,
203+ quality : SnapshotQualityVerdict | undefined ,
204+ ) : boolean {
205+ return (
206+ normalizeSnapshotScope ( options ?. scope ) !== null && quality ?. state !== 'sparse' && ! ! quality
207+ ) ;
208+ }
209+
204210function mergeRunnerCallSignal (
205211 options : RunnerCallOptions ,
206212 signal : AbortSignal | undefined ,
You can’t perform that action at this time.
0 commit comments