mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
* add store for mapping extension names to filesystem paths - add extension mechinism for getting a folder to save files to - add test to make sure that extensions are being loaded - skip extension loading test Signed-off-by: Sebastian Malton <sebastian@malton.name>
32 lines
762 B
TypeScript
32 lines
762 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: AppPaths[process.platform], // path to electron app
|
|
args: [],
|
|
startTimeout: 30000,
|
|
waitTimeout: 60000,
|
|
env: {
|
|
CICD: "true"
|
|
}
|
|
});
|
|
}
|
|
|
|
type AsyncPidGetter = () => Promise<number>;
|
|
|
|
export async function tearDown(app: Application) {
|
|
const pid = await (app.mainProcess.pid as any as AsyncPidGetter)();
|
|
await app.stop();
|
|
try {
|
|
process.kill(pid, "SIGKILL");
|
|
} catch (e) {
|
|
console.error(e);
|
|
}
|
|
}
|