@@ -20,14 +20,17 @@ test('replay leaves deep-link opens to normal device resolution', async () => {
2020 fs . writeFileSync ( replayPath , 'open demo://checkout\n' ) ;
2121
2222 expect (
23- await buildReplayTargetDeviceResolution ( {
24- token : 'test-token' ,
25- session : 'default' ,
26- command : 'replay' ,
27- positionals : [ replayPath ] ,
28- flags : { replayScriptSource : replayScriptSourceBundleFor ( replayPath ) } ,
29- meta : { cwd : root } ,
30- } ) ,
23+ await buildReplayTargetDeviceResolution (
24+ {
25+ token : 'test-token' ,
26+ session : 'default' ,
27+ command : 'replay' ,
28+ positionals : [ replayPath ] ,
29+ flags : { replayScriptSource : replayScriptSourceBundleFor ( replayPath ) } ,
30+ meta : { cwd : root } ,
31+ } ,
32+ process . env ,
33+ ) ,
3134 ) . toBeUndefined ( ) ;
3235} ) ;
3336
@@ -51,14 +54,17 @@ test('native replay uses its authored Android runtime setting without an iOS app
5154 'runtime set --platform android --metro-port 8081\nopen com.example.demo\n' ,
5255 ) ;
5356
54- const resolution = await buildReplayTargetDeviceResolution ( {
55- token : 'test-token' ,
56- session : 'default' ,
57- command : 'replay' ,
58- positionals : [ replayPath ] ,
59- flags : { replayScriptSource : replayScriptSourceBundleFor ( replayPath ) } ,
60- meta : { cwd : root } ,
61- } ) ;
57+ const resolution = await buildReplayTargetDeviceResolution (
58+ {
59+ token : 'test-token' ,
60+ session : 'default' ,
61+ command : 'replay' ,
62+ positionals : [ replayPath ] ,
63+ flags : { replayScriptSource : replayScriptSourceBundleFor ( replayPath ) } ,
64+ meta : { cwd : root } ,
65+ } ,
66+ process . env ,
67+ ) ;
6268
6369 // The request's own flags ride through untouched, so compare the decision this function makes:
6470 // the authored platform, and no iOS app-probe options.
@@ -81,17 +87,20 @@ test('a replay whose wire bundle has a malformed entry stays advisory', async ()
8187
8288 for ( const bundle of malformedBundles ) {
8389 await expect (
84- buildReplayTargetDeviceResolution ( {
85- token : 'test-token' ,
86- session : 'default' ,
87- command : 'replay' ,
88- positionals : [ ] ,
89- flags : {
90- replayBackend : 'maestro' ,
91- replayScriptSource : bundle ,
90+ buildReplayTargetDeviceResolution (
91+ {
92+ token : 'test-token' ,
93+ session : 'default' ,
94+ command : 'replay' ,
95+ positionals : [ ] ,
96+ flags : {
97+ replayBackend : 'maestro' ,
98+ replayScriptSource : bundle ,
99+ } ,
100+ meta : { cwd : mkdtempForTestSync ( 'agent-device-replay-device-selection-' ) } ,
92101 } ,
93- meta : { cwd : mkdtempForTestSync ( 'agent-device-replay-device-selection-' ) } ,
94- } ) ,
102+ process . env ,
103+ ) ,
95104 ) . resolves . toBeUndefined ( ) ;
96105 }
97106} ) ;
@@ -101,19 +110,22 @@ test('a Maestro flow pre-binds an iOS replay to its static appId', async () => {
101110 const flowPath = path . join ( root , 'checkout.yaml' ) ;
102111 fs . writeFileSync ( flowPath , 'appId: com.example.demo\n---\n- launchApp\n' ) ;
103112
104- const resolution = await buildReplayTargetDeviceResolution ( {
105- token : 'test-token' ,
106- session : 'default' ,
107- command : 'replay' ,
108- positionals : [ flowPath ] ,
109- flags : {
110- platform : 'ios' ,
111- replayBackend : 'maestro' ,
112- replayScriptSource : await maestroScriptSourceBundleFor ( flowPath ) ,
113+ const resolution = await buildReplayTargetDeviceResolution (
114+ {
115+ token : 'test-token' ,
116+ session : 'default' ,
117+ command : 'replay' ,
118+ positionals : [ flowPath ] ,
119+ flags : {
120+ platform : 'ios' ,
121+ replayBackend : 'maestro' ,
122+ replayScriptSource : await maestroScriptSourceBundleFor ( flowPath ) ,
123+ } ,
124+ meta : { cwd : root } ,
113125 } ,
114- meta : { cwd : root } ,
115- } ) ;
126+ process . env ,
127+ ) ;
116128
117- expect ( resolution ?. options ) . toEqual ( appTargetResolutionOptions ( 'com.example.demo' ) ) ;
129+ expect ( resolution ?. options ) . toEqual ( appTargetResolutionOptions ( 'com.example.demo' , process . env ) ) ;
118130 expect ( resolution ?. options ) . toBeDefined ( ) ;
119131} ) ;
0 commit comments