@@ -714,8 +714,8 @@ test.each([false, true])(
714714 const host = deploymentHost (
715715 executor ,
716716 xcrunLikeRun ( ( request ) => {
717- if ( request . args [ 0 ] === 'uninstall' || request . args [ 0 ] === 'install' )
718- events . push ( request . args [ 0 ] ) ;
717+ if ( request . args [ 0 ] === 'uninstall' ) events . push ( 'uninstall' ) ;
718+ if ( request . args [ 0 ] === 'install' ) events . push ( 'native-install' ) ;
719719 return bootedSimulatorListResult ( request ) ;
720720 } ) ,
721721 ) ;
@@ -726,7 +726,7 @@ test.each([false, true])(
726726 ...( hosted
727727 ? {
728728 install : async ( ) => {
729- events . push ( 'install' ) ;
729+ events . push ( 'hosted- install' ) ;
730730 return { bundleId : 'com.example.app' } ;
731731 } ,
732732 }
@@ -743,9 +743,43 @@ test.each([false, true])(
743743 'invalidate-before' ,
744744 'uninstall' ,
745745 'materialize' ,
746- ' install',
746+ hosted ? 'hosted-install' : 'native- install',
747747 'cleanup' ,
748748 'invalidate-after' ,
749749 ] ) ;
750750 } ,
751751) ;
752+
753+ test . each ( [
754+ [ { } , { bundleId : 'com.example.app' , appName : 'Example' , launchTarget : 'com.example.app' } ] ,
755+ [
756+ { bundleId : 'com.installed.app' } ,
757+ { bundleId : 'com.installed.app' , appName : 'Example' , launchTarget : 'com.installed.app' } ,
758+ ] ,
759+ [
760+ { bundleId : 'com.installed.app' , appName : 'Installed' , launchTarget : 'installed://home' } ,
761+ { bundleId : 'com.installed.app' , appName : 'Installed' , launchTarget : 'installed://home' } ,
762+ ] ,
763+ ] ) (
764+ 'hosted install preserves metadata and fills artifact defaults: %j' ,
765+ async ( result , expected ) => {
766+ const run = xcrunLikeRun ( bootedSimulatorListResult ) ;
767+ const operations = createAppleAppDeploymentOperations ( {
768+ host : deploymentHost ( { } as AppleAppDeploymentExecutor , run ) ,
769+ device : appleDevice ( ) ,
770+ signal : new AbortController ( ) . signal ,
771+ install : async ( ) => result ,
772+ } ) ;
773+ await expect (
774+ operations . deployMaterializedApp ! ( {
775+ artifact : {
776+ installablePath : '/tmp/Example.app' ,
777+ bundleId : 'com.example.app' ,
778+ appName : 'Example' ,
779+ cleanup : async ( ) => { } ,
780+ } ,
781+ } ) ,
782+ ) . resolves . toEqual ( expected ) ;
783+ expect ( run ) . not . toHaveBeenCalled ( ) ;
784+ } ,
785+ ) ;
0 commit comments