@@ -472,16 +472,17 @@ it.effect.each(["shutdown", "close"] as const)(
472472) ;
473473
474474it . effect . each ( [
475- { hubReportsBooted : false , outcome : "succeeds" } ,
476- { hubReportsBooted : true , outcome : "fails" } ,
475+ { hubReports : "off" , outcome : "succeeds" } ,
476+ { hubReports : "booted" , outcome : "fails" } ,
477+ { hubReports : "missing" , outcome : "fails" } ,
477478] as const ) (
478- "iOS shutdown $outcome when serve-sim rejects it and the hub reports booted=$hubReportsBooted " ,
479- ( { hubReportsBooted , outcome } ) =>
479+ "iOS shutdown $outcome when serve-sim rejects it and the hub reports the simulator $hubReports " ,
480+ ( { hubReports , outcome } ) =>
480481 Effect . gen ( function * ( ) {
481482 const deviceId = DeviceId . make ( "22222222-2222-2222-2222-222222222222" ) ;
482483 const paths : string [ ] = [ ] ;
483484 // The device list is stale until shutdown re-reads it from the hub.
484- let booted = true ;
485+ let listed : " booted" | "off" | "missing" = "booted" ;
485486 const ready : DeviceHost . DeviceHostReady = {
486487 nodePath : process . execPath ,
487488 hub : { origin : "http://device.test" } ,
@@ -514,22 +515,27 @@ it.effect.each([
514515 request ,
515516 Response . json ( {
516517 emulators : [ ] ,
517- simulators : [
518- {
519- id : deviceId ,
520- name : "iPhone" ,
521- platform : "ios" ,
522- version : "26" ,
523- physical : false ,
524- booted,
525- } ,
526- ] ,
518+ simulators :
519+ listed === "missing"
520+ ? [ ]
521+ : [
522+ {
523+ id : deviceId ,
524+ name : "iPhone" ,
525+ platform : "ios" ,
526+ version : "26" ,
527+ physical : false ,
528+ booted : listed === "booted" ,
529+ } ,
530+ ] ,
531+ // A partial listing still decodes; it must not read as "off".
532+ errors : listed === "missing" ? [ { message : "simctl list failed" } ] : [ ] ,
527533 } ) ,
528534 ) ;
529535 }
530536 if ( path === "/vendor/serve-sim/grid/api/shutdown" ) {
531537 // serve-sim runs `simctl shutdown` bare and returns its failure as-is.
532- booted = hubReportsBooted ;
538+ listed = hubReports ;
533539 return HttpClientResponse . fromWeb (
534540 request ,
535541 Response . json (
0 commit comments