1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00
lens/integration/helpers/utils.ts
Panu Horsmalahti c7b24c2922 Add a few missing folders to be linted.
Signed-off-by: Panu Horsmalahti <phorsmalahti@mirantis.com>
2020-11-20 07:47:58 +03:00

32 lines
719 B
TypeScript

import { Application } from "spectron";
const AppPaths: Partial<Record<NodeJS.Platform, string>> = {
"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: AppPaths[process.platform],
startTimeout: 30000,
waitTimeout: 60000,
env: {
CICD: "true"
}
});
}
export async function tearDown(app: Application) {
const mpid: any = app.mainProcess.pid;
const pid = await mpid();
await app.stop();
try {
process.kill(pid, "SIGKILL");
} catch (e) {
console.error(e);
}
}