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

cleanup utils

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2020-09-28 12:18:36 -04:00
parent f1b9af83ac
commit 60b98af068

View File

@ -1,23 +1,16 @@
import { Application } from "spectron"; import { Application } from "spectron";
let appPath = "" const AppPaths: Partial<Record<NodeJS.Platform, string>> = {
switch(process.platform) { "win32": "./dist/win-unpacked/Lens.exe",
case "win32": "linux": "./dist/linux-unpacked/kontena-lens",
appPath = "./dist/win-unpacked/Lens.exe" "darwin": "./dist/mac/Lens.app/Contents/MacOS/Lens",
break
case "linux":
appPath = "./dist/linux-unpacked/kontena-lens"
break
case "darwin":
appPath = "./dist/mac/Lens.app/Contents/MacOS/Lens"
break
} }
export function setup(): Application { export function setup(): Application {
return new Application({ return new Application({
// path to electron app // path to electron app
args: [], args: [],
path: appPath, path: AppPaths[process.platform],
startTimeout: 30000, startTimeout: 30000,
waitTimeout: 30000, waitTimeout: 30000,
chromeDriverArgs: ['remote-debugging-port=9222'], chromeDriverArgs: ['remote-debugging-port=9222'],
@ -32,7 +25,7 @@ export async function tearDown(app: Application) {
await app.stop() await app.stop()
try { try {
process.kill(pid, 0); process.kill(pid, 0);
} catch(e) { } catch (e) {
return return
} }
} }