fail tests in before and after handles

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton committed 2021-02-09 14:54:39 -05:00
1 parent 74fc8b42ad
commit 7395d0c343
4 files changed
+82 -21

No files matched your search

+5 -1
View File
@@ -14,7 +14,11 @@ describe("Lens integration tests", () => {
describe("app start", () => {
beforeAll(async () => {
app = await utils.appStart();
try {
app = await utils.appStart();
} catch (error) {
fail(error);
}
});
beforeEach(() => {
+52 -13
View File
@@ -34,11 +34,21 @@ describe("Lens cluster pages", () => {
};
describe("cluster add", () => {
beforeAll(async () => app = await utils.appStart());
beforeAll(async () => {
try {
app = await utils.appStart();
} catch (error) {
fail(error);
}
});
afterAll(async () => {
if (app?.isRunning()) {
return utils.tearDown(app);
try {
if (app?.isRunning()) {
await utils.tearDown(app);
}
} catch (error) {
fail(error);
}
});
@@ -56,11 +66,21 @@ describe("Lens cluster pages", () => {
};
describe("cluster menu pages", () => {
beforeAll(appStartAddCluster);
beforeAll(async () => {
try {
await appStartAddCluster();
} catch (error) {
fail(error);
}
});
afterAll(async () => {
if (app?.isRunning()) {
return utils.tearDown(app);
try {
if (app?.isRunning()) {
await utils.tearDown(app);
}
} catch (error) {
fail(error);
}
});
@@ -438,14 +458,23 @@ describe("Lens cluster pages", () => {
beforeEach(async () => {
abortContoller = new AbortController();
await appStartAddCluster();
try {
await appStartAddCluster();
} catch (error) {
fail(error);
}
});
afterEach(async () => {
abortContoller.abort();
if (app?.isRunning()) {
await utils.tearDown(app);
try {
if (app?.isRunning()) {
await utils.tearDown(app);
}
} catch (error) {
fail(error);
}
});
@@ -485,11 +514,21 @@ describe("Lens cluster pages", () => {
});
describe("cluster operations", () => {
beforeEach(appStartAddCluster);
beforeEach(async () => {
try {
await appStartAddCluster();
} catch (error) {
fail(error);
}
});
afterEach(async () => {
if (app?.isRunning()) {
return utils.tearDown(app);
try {
if (app?.isRunning()) {
await utils.tearDown(app);
}
} catch (error) {
fail(error);
}
});
+13 -3
View File
@@ -7,11 +7,21 @@ describe("Lens command palette", () => {
let app: Application;
describe("menu", () => {
beforeAll(async () => app = await utils.appStart());
beforeAll(async () => {
try {
app = await utils.appStart();
} catch (error) {
fail(error);
}
});
afterAll(async () => {
if (app?.isRunning()) {
await utils.tearDown(app);
try {
if (app?.isRunning()) {
await utils.tearDown(app);
}
} catch (error) {
fail(error);
}
});
+12 -4
View File
@@ -14,13 +14,21 @@ describe("Lens integration tests", () => {
utils.describeIf(ready)("workspaces", () => {
beforeAll(async () => {
app = await utils.appStart();
await utils.clickWhatsNew(app);
try {
app = await utils.appStart();
await utils.clickWhatsNew(app);
} catch (error) {
fail(error);
}
});
afterAll(async () => {
if (app && app.isRunning()) {
return utils.tearDown(app);
try {
if (app?.isRunning()) {
await utils.tearDown(app);
}
} catch (error) {
fail(error);
}
});