Set default packages/server test timeout to 30 seconds, and unmock console.log.

This commit is contained in:
Sam Rose 2024-03-27 16:57:31 +00:00
parent 204b16876a
commit 4183a0aeb7
No known key found for this signature in database
7 changed files with 2 additions and 19 deletions

View File

@ -1,7 +1,5 @@
const setup = require("../../tests/utilities")
jest.setTimeout(30000)
describe("/metrics", () => {
let request = setup.getRequest()
let config = setup.getConfig()

View File

@ -1,7 +1,6 @@
import * as setup from "./utilities"
import path from "path"
jest.setTimeout(15000)
const PASSWORD = "testtest"
describe("/applications/:appId/import", () => {

View File

@ -23,8 +23,6 @@ let {
collectAutomation,
} = setup.structures
jest.setTimeout(30000)
describe("/automations", () => {
let request = setup.getRequest()
let config = setup.getConfig()

View File

@ -3,8 +3,6 @@ import { checkPermissionsEndpoint } from "./utilities/TestFunctions"
import * as setup from "./utilities"
import { UserMetadata } from "@budibase/types"
jest.setTimeout(30000)
jest.mock("../../../utilities/workerRequests", () => ({
getGlobalUsers: jest.fn(() => {
return {}

View File

@ -25,8 +25,6 @@ const clearMigrations = async () => {
}
}
jest.setTimeout(10000)
describe("migrations", () => {
const config = new TestConfig()

View File

@ -17,8 +17,6 @@ import {
generator,
} from "@budibase/backend-core/tests"
jest.setTimeout(30000)
describe("external search", () => {
const config = new TestConfiguration()

View File

@ -2,17 +2,11 @@ import env from "../environment"
import { env as coreEnv, timers } from "@budibase/backend-core"
import { testContainerUtils } from "@budibase/backend-core/tests"
if (!process.env.DEBUG) {
global.console.log = jest.fn() // console.log are ignored in tests
global.console.warn = jest.fn() // console.warn are ignored in tests
}
if (!process.env.CI) {
// set a longer timeout in dev for debugging
// 100 seconds
// set a longer timeout in dev for debugging 100 seconds
jest.setTimeout(100 * 1000)
} else {
jest.setTimeout(10 * 1000)
jest.setTimeout(30 * 1000)
}
testContainerUtils.setupEnv(env, coreEnv)