From 5d4d1fde7c85a774949a4d7b52e426e7c735da17 Mon Sep 17 00:00:00 2001 From: Simon Knott Date: Fri, 4 Oct 2024 16:22:06 +0200 Subject: [PATCH] cleanup --- packages/playwright/src/runner/watchMode.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/playwright/src/runner/watchMode.ts b/packages/playwright/src/runner/watchMode.ts index 9c164e7ff3..4528964142 100644 --- a/packages/playwright/src/runner/watchMode.ts +++ b/packages/playwright/src/runner/watchMode.ts @@ -302,7 +302,7 @@ async function runTests(watchOptions: WatchModeOptions, testServerConnection: Te }) { printConfiguration(watchOptions, options?.title); - void readKeyPress((text: string, key: any) => { + const waitForDone = readKeyPress((text: string, key: any) => { if (isInterrupt(text, key)) { testServerConnection.stopTestsNoReply({}); return 'done'; @@ -318,7 +318,7 @@ async function runTests(watchOptions: WatchModeOptions, testServerConnection: Te reuseContext: connectWsEndpoint ? true : undefined, workers: connectWsEndpoint ? 1 : undefined, headed: connectWsEndpoint ? true : undefined, - }); + }).finally(() => waitForDone.cancel()); } function readCommand() {