Fix automation timeouts

This commit is contained in:
adrinr 2023-02-03 16:28:29 +00:00
parent 2edb48e47b
commit 4a8db61b6b
2 changed files with 8 additions and 4 deletions

View File

@ -16,10 +16,14 @@ describe("/automations", () => {
afterAll(setup.afterAll) afterAll(setup.afterAll)
beforeEach(async () => { beforeAll(async () => {
await config.init() await config.init()
}) })
beforeEach(() => {
jest.clearAllMocks()
})
describe("get definitions", () => { describe("get definitions", () => {
it("returns a list of definitions for actions", async () => { it("returns a list of definitions for actions", async () => {
const res = await request const res = await request

View File

@ -39,7 +39,7 @@ import { cleanup } from "../../utilities/fileSystem"
import newid from "../../db/newid" import newid from "../../db/newid"
import { generateUserMetadataID } from "../../db/utils" import { generateUserMetadataID } from "../../db/utils"
import { startup } from "../../startup" import { startup } from "../../startup"
import { AuthToken } from "@budibase/types" import { AuthToken, Database } from "@budibase/types"
const supertest = require("supertest") const supertest = require("supertest")
type DefaultUserValues = { type DefaultUserValues = {
@ -229,7 +229,7 @@ class TestConfiguration {
email = this.defaultUserValues.email, email = this.defaultUserValues.email,
roles, roles,
}: any = {}) { }: any = {}) {
return tenancy.doWithGlobalDB(this.getTenantId(), async (db: any) => { return tenancy.doWithGlobalDB(this.getTenantId(), async (db: Database) => {
let existing let existing
try { try {
existing = await db.get(id) existing = await db.get(id)
@ -261,7 +261,7 @@ class TestConfiguration {
} }
const resp = await db.put(user) const resp = await db.put(user)
return { return {
_rev: resp._rev, _rev: resp.rev,
...user, ...user,
} }
}) })