@@ -41,16 +41,19 @@ test('pass specific options to a context', async t => {
4141 } )
4242 } )
4343
44- const targetUrl = await runServer ( t , ( { res } ) => res . end ( ) )
45-
46- const { host : proxyServer } = new URL ( proxyUrl )
47- const browserless = await getBrowserContext ( t , { proxyServer } )
48- const page = await browserless . page ( )
49- t . teardown ( ( ) => page . close ( ) )
44+ const url = await runServer ( t , ( { res } ) => {
45+ res . writeHead ( 200 , { 'Content-Type' : 'text/html' } )
46+ res . end ( '<html><body><h1>origin server reached</h1></body></html>' )
47+ } )
5048
51- await browserless . goto ( page , { url : targetUrl } )
49+ const browserless = await getBrowserContext ( t , { proxyServer : proxyUrl . slice ( 0 , - 1 ) } )
50+ const text = await browserless . text ( url )
5251
53- t . deepEqual ( proxiedRequestUrls , [ targetUrl , new URL ( '/favicon.ico' , targetUrl ) . toString ( ) ] )
52+ t . is ( text , 'origin server reached' )
53+ t . deepEqual ( proxiedRequestUrls , [
54+ new URL ( url ) . toString ( ) ,
55+ new URL ( '/favicon.ico' , url ) . toString ( )
56+ ] )
5457} )
5558
5659test ( 'ensure to destroy browser contexts' , async t => {
0 commit comments