diff --git a/integration/helpers/utils.ts b/integration/helpers/utils.ts index 783111d0fd..5d121b5d43 100644 --- a/integration/helpers/utils.ts +++ b/integration/helpers/utils.ts @@ -74,21 +74,20 @@ export async function start() { timeout: 100_000, }); - const cleanup = async () => { - await app.close(); - await remove(CICD).catch(noop); - }; - try { const window = await getMainWindow(app); return { app, window, - cleanup, + cleanup: async () => { + await app.close(); + await remove(CICD).catch(noop); + }, }; } catch (error) { - await cleanup(); + await app.close(); + await remove(CICD).catch(noop); throw error; } }