1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00
lens/integration/helpers/utils.ts
Roman b7974827d2
Lens restructure (#540)
Signed-off-by: Roman <ixrock@gmail.com>
2020-06-30 14:35:16 +03:00

35 lines
664 B
TypeScript

import { Application } from "spectron";
let appPath = ""
switch(process.platform) {
case "win32":
appPath = "./dist/win-unpacked/LensDev.exe"
break
case "linux":
appPath = "./dist/linux-unpacked/kontena-lens"
break
case "darwin":
appPath = "./dist/mac/LensDev.app/Contents/MacOS/LensDev"
break
}
export function setup(): Application {
return new Application({
// path to electron app
args: [],
path: appPath,
startTimeout: 30000,
waitTimeout: 30000,
})
}
export async function tearDown(app: Application) {
const pid = app.mainProcess.pid
await app.stop()
try {
process.kill(pid, 0);
} catch(e) {
return
}
}