@@ -185,33 +185,28 @@ test('resolveTargetDevice selects the unique booted simulator with the requested
185185 ) ;
186186} ) ;
187187
188- test ( 'resolveTargetDevice uses app-aware iOS selection when platform is omitted' , async ( ) => {
189- mockListAppleDevices . mockResolvedValue ( [ bootedSimulator , secondBootedSimulator ] ) ;
190- mockFindIosSimulatorInstalledApp . mockImplementation ( async ( device ) =>
191- device . id === secondBootedSimulator . id ? 'com.example.demo' : undefined ,
188+ test ( 'resolveTargetDevice leaves platform-less static app selection to normal cross-platform resolution' , async ( ) => {
189+ const result = await withDeviceInventoryProvider (
190+ async ( request ) => {
191+ assert . equal ( request . platform , undefined ) ;
192+ return [ androidEmulator , bootedSimulator , secondBootedSimulator ] ;
193+ } ,
194+ async ( ) => await resolveTargetDevice ( { } , { appleSimulatorAppTarget : 'com.example.demo' } ) ,
192195 ) ;
193196
194- const result = await resolveTargetDevice ( { } , { appleSimulatorAppTarget : 'com.example.demo' } ) ;
195-
196- assert . equal ( result . id , secondBootedSimulator . id ) ;
197- assert . deepEqual (
198- mockFindIosSimulatorInstalledApp . mock . calls . map ( ( [ device , app ] ) => [ device . id , app ] ) ,
199- [
200- [ bootedSimulator . id , 'com.example.demo' ] ,
201- [ secondBootedSimulator . id , 'com.example.demo' ] ,
202- ] ,
203- ) ;
197+ assert . equal ( result . id , androidEmulator . id ) ;
198+ assert . equal ( mockFindIosSimulatorInstalledApp . mock . calls . length , 0 ) ;
204199} ) ;
205200
206- test ( 'resolveTargetDevice reuses an app-aware selection for later platform-inferred resolution' , async ( ) => {
201+ test ( 'resolveTargetDevice reuses an app-aware iOS selection for later iOS resolution' , async ( ) => {
207202 mockListAppleDevices . mockResolvedValue ( [ bootedSimulator , secondBootedSimulator ] ) ;
208203 mockFindIosSimulatorInstalledApp . mockImplementation ( async ( device ) =>
209204 device . id === secondBootedSimulator . id ? 'com.example.demo' : undefined ,
210205 ) ;
211206
212207 const [ appAware , laterResolution ] = await withResolveTargetDeviceCacheScope ( async ( ) => [
213- await resolveTargetDevice ( { } , { appleSimulatorAppTarget : 'com.example.demo' } ) ,
214- await resolveTargetDevice ( { } ) ,
208+ await resolveTargetDevice ( { platform : 'ios' } , { appleSimulatorAppTarget : 'com.example.demo' } ) ,
209+ await resolveTargetDevice ( { platform : 'ios' } ) ,
215210 ] ) ;
216211
217212 assert . equal ( appAware . id , secondBootedSimulator . id ) ;
0 commit comments