1
0
Fork 0
mirror of synced 2024-09-20 03:08:18 +12:00
budibase/packages/server/src/tests/jestSetup.ts
Rory Powell 976b3a55ca Update logging to support dd trace attributes (#10086)
* Update logging middleware to integrate with pino for console logging

* Remove elastic apm references, use updated core middlewares

* Remove redundant LOG_LEVEL definitions

* Remove no longer needed jest logging overrides

* lint

* Backwards compat between console log helpers and pino

* Configurable DISABLE_HTTP_LOGGING

* Don't log 4xx as errors

* Remove redundant ENABLE_4XX_HTTP_LOGGING

* Cleanup migrations and event logging

* Improve bb-alert logging

* Add DISABLE_HTTP_LOGGING to helm chart

* Add ops endpoints for testing

* Disable http logging in dev

* Backwards compatible tracing implementation

* Naming update on http logging env var

* lint

* Update packages/backend-core/src/environment.ts

Co-authored-by: Adria Navarro <adria@revityapp.com>

* Merge

* Lint

* Fix console.warn failing mock by replacing with alerts mock instead

* Lint

---------

Co-authored-by: Adria Navarro <adria@revityapp.com>
2023-04-04 15:08:46 +01:00

22 lines
573 B
TypeScript

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
jest.setTimeout(100 * 1000)
} else {
jest.setTimeout(10 * 1000)
}
testContainerUtils.setupEnv(env, coreEnv)
afterAll(() => {
timers.cleanup()
})