integration tests via spectron

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
Jari Kolehmainen committed 2020-06-08 10:56:07 +03:00
1 parent 5af12bdbbd
commit cff4365b35
8 files changed
+473 -28

No files matched your search

+35
View File
@@ -0,0 +1,35 @@
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
}
}