mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
* Add some basic unit tests for cluster, kube-auth-proxy, and kubeconfig-manager - src/main/cluster.ts - src/main/kube-auth-proxy.ts - src/main/kubeconfig-manager.ts Signed-off-by: Sebastian Malton <sebastian@malton.name>
32 lines
716 B
TypeScript
32 lines
716 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,
|
|
chromeDriverArgs: ['remote-debugging-port=9222'],
|
|
env: {
|
|
CICD: "true"
|
|
}
|
|
})
|
|
}
|
|
|
|
export async function tearDown(app: Application) {
|
|
const pid = app.mainProcess.pid
|
|
await app.stop()
|
|
try {
|
|
process.kill(pid, 0);
|
|
} catch (e) {
|
|
return
|
|
}
|
|
}
|