From 832ce615a8849ab9e578dff9114f7c8fbae707de Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Fri, 5 Apr 2024 18:13:32 -0700 Subject: [PATCH] remove configLocation from callback --- packages/playwright/src/runner/testServer.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/playwright/src/runner/testServer.ts b/packages/playwright/src/runner/testServer.ts index b414953b5f..19a43beed0 100644 --- a/packages/playwright/src/runner/testServer.ts +++ b/packages/playwright/src/runner/testServer.ts @@ -409,7 +409,8 @@ class TestServerDispatcher implements TestServerInterface { } export async function runUIMode(configFile: string | undefined, options: TraceViewerServerOptions & TraceViewerRedirectOptions): Promise { - return await innerRunTestServer(configFile, options, async (server: HttpServer, cancelPromise: ManualPromise, configLocation: ConfigLocation) => { + const configLocation = resolveConfigLocation(configFile); + return await innerRunTestServer(configLocation, options, async (server: HttpServer, cancelPromise: ManualPromise) => { await installRootRedirect(server, [], { ...options, webApp: 'uiMode.html' }); if (options.host !== undefined || options.port !== undefined) { await openTraceInBrowser(server.urlPrefix()); @@ -426,16 +427,16 @@ export async function runUIMode(configFile: string | undefined, options: TraceVi } export async function runTestServer(configFile: string | undefined, options: { host?: string, port?: number }): Promise { - return await innerRunTestServer(configFile, options, async server => { + const configLocation = resolveConfigLocation(configFile); + return await innerRunTestServer(configLocation, options, async server => { // eslint-disable-next-line no-console console.log('Listening on ' + server.urlPrefix().replace('http:', 'ws:') + '/' + server.wsGuid()); }); } -async function innerRunTestServer(configFile: string | undefined, options: { host?: string, port?: number }, openUI: (server: HttpServer, cancelPromise: ManualPromise, configLocation: ConfigLocation) => Promise): Promise { +async function innerRunTestServer(configLocation: ConfigLocation, options: { host?: string, port?: number }, openUI: (server: HttpServer, cancelPromise: ManualPromise, configLocation: ConfigLocation) => Promise): Promise { if (restartWithExperimentalTsEsm(undefined, true)) return 'restarted'; - const configLocation = resolveConfigLocation(configFile); const testServer = new TestServer(configLocation); const cancelPromise = new ManualPromise(); const sigintWatcher = new SigIntWatcher();