2021-05-05 18:49:34 +02:00
|
|
|
const env = require("../src/environment")
|
2022-05-31 22:04:41 +02:00
|
|
|
|
|
|
|
env._set("SELF_HOSTED", "1")
|
|
|
|
env._set("NODE_ENV", "jest")
|
|
|
|
env._set("JWT_SECRET", "test-jwtsecret")
|
|
|
|
env._set("LOG_LEVEL", "silent")
|
|
|
|
env._set("MULTI_TENANCY", true)
|
|
|
|
|
2022-06-09 13:33:10 +02:00
|
|
|
const core = require("@budibase/backend-core")
|
|
|
|
const { mocks, init } = require("@budibase/backend-core/tests")
|
|
|
|
init(core)
|
2022-04-11 15:39:31 +02:00
|
|
|
|
|
|
|
// mock all dates to 2020-01-01T00:00:00.000Z
|
|
|
|
// use tk.reset() to use real dates in individual tests
|
|
|
|
const tk = require("timekeeper")
|
|
|
|
tk.freeze(mocks.date.MOCK_DATE)
|
2021-05-05 18:49:34 +02:00
|
|
|
|
2022-05-31 22:04:41 +02:00
|
|
|
global.console.log = jest.fn() // console.log are ignored in tests
|