Refactor testing harness to use defaults (#808)

* Refactor testing harness to use defaults

- Move tests into defaultly named test folders
- Use default test suffix of ".test" instead of "_test"
- Make cluster-store tests unit tests by adding more
    nesting, so that order of tests doesn't matter

Signed-off-by: Sebastian Malton <sebastian@malton.name>

Co-authored-by: Sebastian Malton <smalton@mirantis.com>
This commit is contained in:
Sebastian MaltonandSebastian Malton authored and GitHub committed 2020-10-02 10:05:59 -04:00
1 parent 14d3d88278
commit 87061cee9e
25 files changed
+345 -307

No files matched your search

File renamed without changes.
+6 -13
View File
@@ -1,23 +1,16 @@
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/Lens.app/Contents/MacOS/Lens"
break
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: appPath,
path: AppPaths[process.platform],
startTimeout: 30000,
waitTimeout: 30000,
chromeDriverArgs: ['remote-debugging-port=9222'],
@@ -32,7 +25,7 @@ export async function tearDown(app: Application) {
await app.stop()
try {
process.kill(pid, 0);
} catch(e) {
} catch (e) {
return
}
}