@@ -61,11 +61,9 @@ describe('Docker CLI interception', function () {
61
61
62
62
// Run the resulting container via the intercepting Docker proxy:
63
63
const { server, httpsConfig} = await testSetup ;
64
- const mainRule = await server . get ( 'https://example.test' ) . thenReply ( 200 ) ;
64
+ const mainRule = await server . forGet ( 'https://example.test' ) . thenReply ( 200 ) ;
65
65
66
- const terminalEnvOverrides = getTerminalEnvVars ( server . port , httpsConfig , process . env , { } , {
67
- dockerEnabled : true
68
- } ) ;
66
+ const terminalEnvOverrides = getTerminalEnvVars ( server . port , httpsConfig , process . env , { } ) ;
69
67
70
68
childProc . spawn (
71
69
'docker' , [ 'run' , '--rm' , imageId , 'https://example.test' ] ,
@@ -94,11 +92,9 @@ describe('Docker CLI interception', function () {
94
92
it ( "should intercept 'docker run' launching a remote image" , async ( ) => {
95
93
const { server, httpsConfig } = await testSetup ;
96
94
97
- const mainRule = await server . get ( "https://example.test" ) . thenReply ( 200 ) ;
95
+ const mainRule = await server . forGet ( "https://example.test" ) . thenReply ( 200 ) ;
98
96
99
- const terminalEnvOverrides = getTerminalEnvVars ( server . port , httpsConfig , process . env , { } , {
100
- dockerEnabled : true
101
- } ) ;
97
+ const terminalEnvOverrides = getTerminalEnvVars ( server . port , httpsConfig , process . env , { } ) ;
102
98
103
99
const { exitCode, stdout, stderr } = await spawnToResult (
104
100
'docker' , [ 'run' , '--rm' , 'node:14' , '-e' , `require("https").get("https://example.test")` ] ,
@@ -120,11 +116,9 @@ describe('Docker CLI interception', function () {
120
116
121
117
const { server, httpsConfig } = await testSetup ;
122
118
123
- const mainRule = await server . anyRequest ( ) . thenReply ( 200 , "Mock response\n" ) ;
119
+ const mainRule = await server . forAnyRequest ( ) . thenReply ( 200 , "Mock response\n" ) ;
124
120
125
- const terminalEnvOverrides = getTerminalEnvVars ( server . port , httpsConfig , process . env , { } , {
126
- dockerEnabled : true
127
- } ) ;
121
+ const terminalEnvOverrides = getTerminalEnvVars ( server . port , httpsConfig , process . env , { } ) ;
128
122
129
123
const { exitCode, stdout, stderr } = await spawnToResult ( 'docker' , [ 'build' , '.' ] , {
130
124
env : { ...process . env , ...terminalEnvOverrides } ,
@@ -191,11 +185,11 @@ Successfully built <hash>
191
185
this . timeout ( 30000 ) ;
192
186
193
187
const { server, httpsConfig, getPassThroughOptions } = await testSetup ;
194
- const externalRule = await server . anyRequest ( )
188
+ const externalRule = await server . forAnyRequest ( )
195
189
. forHost ( "example.test" )
196
190
. thenReply ( 200 , "Mock response" ) ;
197
191
const internalRule = await server
198
- . unmatchedRequest ( )
192
+ . forUnmatchedRequest ( )
199
193
. thenPassThrough ( {
200
194
proxyConfig : ruleParams [ `docker-tunnel-proxy-${ server . port } ` ] ,
201
195
...( await getPassThroughOptions ( ) )
@@ -209,9 +203,7 @@ Successfully built <hash>
209
203
true
210
204
) ;
211
205
212
- const terminalEnvOverrides = getTerminalEnvVars ( server . port , httpsConfig , process . env , { } , {
213
- dockerEnabled : true
214
- } ) ;
206
+ const terminalEnvOverrides = getTerminalEnvVars ( server . port , httpsConfig , process . env , { } ) ;
215
207
216
208
// "DC Up" the same project, but in an intercepted env. Should ignore the existing containers,
217
209
// create new intercepted containers, and then up those as normal.
@@ -242,11 +234,11 @@ Successfully built <hash>
242
234
this . timeout ( 30000 ) ;
243
235
244
236
const { server, httpsConfig, getPassThroughOptions } = await testSetup ;
245
- await server . anyRequest ( )
237
+ await server . forAnyRequest ( )
246
238
. forHost ( "example.test" )
247
239
. thenReply ( 200 , "Mock response" ) ;
248
240
await server
249
- . unmatchedRequest ( )
241
+ . forUnmatchedRequest ( )
250
242
. thenPassThrough ( {
251
243
proxyConfig : ruleParams [ `docker-tunnel-proxy-${ server . port } ` ] ,
252
244
...( await getPassThroughOptions ( ) )
@@ -260,9 +252,7 @@ Successfully built <hash>
260
252
true
261
253
) ;
262
254
263
- const terminalEnvOverrides = getTerminalEnvVars ( server . port , httpsConfig , process . env , { } , {
264
- dockerEnabled : true
265
- } ) ;
255
+ const terminalEnvOverrides = getTerminalEnvVars ( server . port , httpsConfig , process . env , { } ) ;
266
256
267
257
// "DC Up" the same project, but in an intercepted env. Should ignore the existing containers,
268
258
// create new intercepted containers, and then up those as normal.
@@ -296,9 +286,7 @@ Successfully built <hash>
296
286
it ( "should clean up containers after shutdown" , async ( ) => {
297
287
const { server, httpsConfig } = await testSetup ;
298
288
299
- const terminalEnvOverrides = getTerminalEnvVars ( server . port , httpsConfig , process . env , { } , {
300
- dockerEnabled : true
301
- } ) ;
289
+ const terminalEnvOverrides = getTerminalEnvVars ( server . port , httpsConfig , process . env , { } ) ;
302
290
303
291
const uninterceptedResult = await spawnToResult ( 'docker' , [ 'create' , 'node:14' ] ) ;
304
292
@@ -340,9 +328,7 @@ Successfully built <hash>
340
328
const { server, httpsConfig } = await testSetup ;
341
329
const docker = new Docker ( ) ;
342
330
343
- const terminalEnvOverrides = getTerminalEnvVars ( server . port , httpsConfig , process . env , { } , {
344
- dockerEnabled : true
345
- } ) ;
331
+ const terminalEnvOverrides = getTerminalEnvVars ( server . port , httpsConfig , process . env , { } ) ;
346
332
347
333
// Tunnel doesn't start preemptively:
348
334
await delay ( 500 ) ;
0 commit comments