From 60b98af068a9f7f2da13ae9d261d99244dd82123 Mon Sep 17 00:00:00 2001 From: Sebastian Malton Date: Mon, 28 Sep 2020 12:18:36 -0400 Subject: [PATCH] cleanup utils Signed-off-by: Sebastian Malton --- integration/helpers/utils.ts | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/integration/helpers/utils.ts b/integration/helpers/utils.ts index 72d6e3d732..a50b13e023 100644 --- a/integration/helpers/utils.ts +++ b/integration/helpers/utils.ts @@ -1,23 +1,16 @@ import { Application } from "spectron"; -let appPath = "" -switch(process.platform) { -case "win32": - appPath = "./dist/win-unpacked/Lens.exe" - break -case "linux": - appPath = "./dist/linux-unpacked/kontena-lens" - break -case "darwin": - appPath = "./dist/mac/Lens.app/Contents/MacOS/Lens" - break +const AppPaths: Partial> = { + "win32": "./dist/win-unpacked/Lens.exe", + "linux": "./dist/linux-unpacked/kontena-lens", + "darwin": "./dist/mac/Lens.app/Contents/MacOS/Lens", } export function setup(): Application { return new Application({ // path to electron app args: [], - path: appPath, + path: AppPaths[process.platform], startTimeout: 30000, waitTimeout: 30000, chromeDriverArgs: ['remote-debugging-port=9222'], @@ -32,7 +25,7 @@ export async function tearDown(app: Application) { await app.stop() try { process.kill(pid, 0); - } catch(e) { + } catch (e) { return } }