Flaky test

This commit is contained in:
Adria Navarro 2023-02-05 10:00:27 +00:00
parent 4522d6c906
commit 0a47b35285
1 changed files with 6 additions and 2 deletions

View File

@ -19,7 +19,7 @@ describe("/automations", () => {
beforeAll(async () => { beforeAll(async () => {
await config.init() await config.init()
}) })
beforeEach(() => { beforeEach(() => {
jest.clearAllMocks() jest.clearAllMocks()
}) })
@ -123,6 +123,10 @@ describe("/automations", () => {
}) })
describe("test", () => { describe("test", () => {
beforeEach(async () => {
await config.init()
})
it("tests the automation successfully", async () => { it("tests the automation successfully", async () => {
let table = await config.createTable() let table = await config.createTable()
let automation = newAutomation() let automation = newAutomation()
@ -309,7 +313,7 @@ describe("/automations", () => {
.expect('Content-Type', /json/) .expect('Content-Type', /json/)
.expect(200) .expect(200)
expect(res.body[0]).toEqual(expect.objectContaining(autoConfig)) expect(res.body[0]).toEqual(expect.objectContaining(autoConfig))
}) })
it("should apply authorization to endpoint", async () => { it("should apply authorization to endpoint", async () => {