mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Integration tests using spectron (#410)
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
1 parent
af24da976b
commit
deb4bf2f7b
9 files changed
+513
-29
No files matched your search
@@ -0,0 +1,34 @@
|
||||
import { Application } from "spectron";
|
||||
|
||||
let appPath = ""
|
||||
switch(process.platform) {
|
||||
case "win32":
|
||||
appPath = "./dist/win-unpacked/Lens.exe"
|
||||
break
|
||||
case "linux":
|
||||
appPath = "./dist/linux-unpacked/kontena-lens"
|
||||
break
|
||||
case "darwin":
|
||||
appPath = "./dist/mac/LensDev.app/Contents/MacOS/LensDev"
|
||||
break
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user