From 2f2c8a50cce3be7cdfb5b76c484b9a6562cea9f3 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Sun, 5 Feb 2023 10:33:21 +0000 Subject: [PATCH] Flaky test --- .../server/src/api/routes/tests/automation.spec.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/packages/server/src/api/routes/tests/automation.spec.js b/packages/server/src/api/routes/tests/automation.spec.js index 61d6b7db9a..2cb05a1483 100644 --- a/packages/server/src/api/routes/tests/automation.spec.js +++ b/packages/server/src/api/routes/tests/automation.spec.js @@ -16,14 +16,11 @@ describe("/automations", () => { afterAll(setup.afterAll) - beforeAll(async () => { + // For some reason this cannot be a beforeAll or the test "tests the automation successfully" fail + beforeEach(async () => { await config.init() }) - beforeEach(() => { - jest.clearAllMocks() - }) - describe("get definitions", () => { it("returns a list of definitions for actions", async () => { const res = await request @@ -123,10 +120,6 @@ describe("/automations", () => { }) describe("test", () => { - beforeEach(async () => { - await config.init() - }) - it("tests the automation successfully", async () => { let table = await config.createTable() let automation = newAutomation()