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,9 +16,13 @@ describe("/automations", () => {
afterAll(setup.afterAll)
beforeEach(async () => {
beforeAll(async () => {
await config.init()
})
beforeEach(() => {
jest.clearAllMocks()
})
describe("get definitions", () => {
it("returns a list of definitions for actions", async () => {

View File

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