From 11f0e6335e56aec6e2298f780d4dd0794c589f00 Mon Sep 17 00:00:00 2001 From: Timmy Willison Date: Fri, 8 Mar 2024 18:40:55 -0500 Subject: [PATCH] Tests: fix cleanup in cases where server doesn't stop --- test/runner/run.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/runner/run.js b/test/runner/run.js index 1dfa24cba..0de46f3bb 100644 --- a/test/runner/run.js +++ b/test/runner/run.js @@ -170,21 +170,21 @@ export async function run( { async function cleanup() { console.log( "Cleaning up..." ); + await cleanupAllBrowsers( { verbose } ); + cleanupAllJSDOM( { verbose } ); + if ( tunnel ) { await tunnel.stop(); if ( verbose ) { console.log( "Stopped BrowserStackLocal." ); } } - - await cleanupAllBrowsers( { verbose } ); - cleanupAllJSDOM( { verbose } ); } asyncExitHook( async() => { - await stopServer(); await cleanup(); + await stopServer(); }, { wait: EXIT_HOOK_WAIT_TIMEOUT } );