mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
move itif and describeif into utils
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
4ab4ccfc8c
commit
6c63fb26f6
@ -8,10 +8,6 @@ import { Application } from "spectron";
|
|||||||
import * as util from "../helpers/utils";
|
import * as util from "../helpers/utils";
|
||||||
import { spawnSync } from "child_process";
|
import { spawnSync } from "child_process";
|
||||||
|
|
||||||
// eslint-disable-next-line unused-imports/no-unused-vars-ts
|
|
||||||
const itif = (condition: boolean) => condition ? it : it.skip;
|
|
||||||
const describeif = (condition: boolean) => condition ? describe : describe.skip;
|
|
||||||
|
|
||||||
jest.setTimeout(60000);
|
jest.setTimeout(60000);
|
||||||
|
|
||||||
// FIXME (!): improve / simplify all css-selectors + use [data-test-id="some-id"] (already used in some tests below)
|
// FIXME (!): improve / simplify all css-selectors + use [data-test-id="some-id"] (already used in some tests below)
|
||||||
@ -107,7 +103,7 @@ describe("Lens integration tests", () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describeif(ready)("workspaces", () => {
|
util.describeIf(ready)("workspaces", () => {
|
||||||
beforeAll(appStart, 20000);
|
beforeAll(appStart, 20000);
|
||||||
|
|
||||||
afterAll(async () => {
|
afterAll(async () => {
|
||||||
@ -171,7 +167,7 @@ describe("Lens integration tests", () => {
|
|||||||
await app.client.waitUntilTextExists("span.link-text", "Cluster");
|
await app.client.waitUntilTextExists("span.link-text", "Cluster");
|
||||||
};
|
};
|
||||||
|
|
||||||
describeif(ready)("cluster tests", () => {
|
util.describeIf(ready)("cluster tests", () => {
|
||||||
let clusterAdded = false;
|
let clusterAdded = false;
|
||||||
|
|
||||||
const addCluster = async () => {
|
const addCluster = async () => {
|
||||||
|
|||||||
@ -6,6 +6,14 @@ const AppPaths: Partial<Record<NodeJS.Platform, string>> = {
|
|||||||
"darwin": "./dist/mac/Lens.app/Contents/MacOS/Lens",
|
"darwin": "./dist/mac/Lens.app/Contents/MacOS/Lens",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export function itIf(condition: boolean) {
|
||||||
|
return condition ? it : it.skip;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function describeIf(condition: boolean) {
|
||||||
|
return condition ? describe : describe.skip;
|
||||||
|
}
|
||||||
|
|
||||||
export function setup(): Application {
|
export function setup(): Application {
|
||||||
return new Application({
|
return new Application({
|
||||||
path: AppPaths[process.platform], // path to electron app
|
path: AppPaths[process.platform], // path to electron app
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user