1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00
lens/spec/integration/helpers/utils.ts
Jari Kolehmainen cff4365b35 integration tests via spectron
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
2020-06-08 10:56:07 +03:00

36 lines
698 B
TypeScript

import { Application } from "spectron";
import * as path from "path"
let appPath = ""
switch(process.platform) {
case "win32": {
appPath = path.join("./dist/win-unpacked/Lens.exe")
}
case "linux": {
appPath = path.join("./dist/linux-unpacked/kontena-lens")
}
case "darwin": {
appPath = path.join("./dist/mac/LensDev.app/Contents/MacOS/LensDev")
}
}
export function setup() {
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
}
}