Tests: fix cleanup in cases where server doesn't stop

This commit is contained in:
Timmy Willison 2024-03-08 18:40:55 -05:00
parent 79329f5015
commit 11f0e6335e

View File

@ -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 }
);