1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

revert to using app.close() and catch remove tmpDir errors

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2021-08-25 13:29:00 -04:00
parent 19943bf172
commit 2f8ff0220b

View File

@ -24,6 +24,7 @@ import * as os from "os";
import * as path from "path"; import * as path from "path";
import * as uuid from "uuid"; import * as uuid from "uuid";
import { ElectronApplication, Frame, Page, _electron as electron } from "playwright"; import { ElectronApplication, Frame, Page, _electron as electron } from "playwright";
import { noop } from "lodash";
export const AppPaths: Partial<Record<NodeJS.Platform, string>> = { export const AppPaths: Partial<Record<NodeJS.Platform, string>> = {
"win32": "./dist/win-unpacked/OpenLens.exe", "win32": "./dist/win-unpacked/OpenLens.exe",
@ -59,7 +60,7 @@ export async function start() {
const CICD = path.join(os.tmpdir(), "lens-integration-testing", uuid.v4()); const CICD = path.join(os.tmpdir(), "lens-integration-testing", uuid.v4());
// Make sure that the directory is clear // Make sure that the directory is clear
await remove(CICD); await remove(CICD).catch(noop);
await mkdirp(CICD); await mkdirp(CICD);
const app = await electron.launch({ const app = await electron.launch({
@ -77,13 +78,13 @@ export async function start() {
app, app,
window, window,
cleanup: async () => { cleanup: async () => {
await app.evaluateHandle(({ app }) => app.quit()); await app.close();
await remove(CICD); await remove(CICD).catch(noop);
}, },
}; };
} catch (error) { } catch (error) {
await app.evaluateHandle(({ app }) => app.quit()); await app.close();
await remove(CICD); await remove(CICD).catch(noop);
throw error; throw error;
} }
} }