1
0
Fork 0
mirror of synced 2024-10-03 19:43:32 +13:00

Use couchdb from docker container

This commit is contained in:
Adria Navarro 2023-01-23 16:45:06 +00:00
parent 486bc6b18d
commit 106563c449
2 changed files with 21 additions and 1 deletions

View file

@ -5,7 +5,6 @@ const preset = require("ts-jest/jest-preset")
const config: Config.InitialOptions = {
...preset,
preset: "@trendyol/jest-testcontainers",
testEnvironment: "node",
setupFiles: ["./src/tests/jestEnv.ts"],
setupFilesAfterEnv: ["./src/tests/jestSetup.ts"],
collectCoverageFrom: [

View file

@ -1,3 +1,5 @@
import env from "../environment"
import { env as coreEnv } from "@budibase/backend-core"
import { mocks } from "@budibase/backend-core/tests"
// mock all dates to 2020-01-01T00:00:00.000Z
@ -15,3 +17,22 @@ if (!process.env.CI) {
// 100 seconds
jest.setTimeout(100000)
}
function overrideConfigValue(key: string, value: string) {
env._set(key, value)
coreEnv._set(key, value)
}
overrideConfigValue("COUCH_DB_PORT", global.__TESTCONTAINERS_DEVENV_PORT_5984__)
overrideConfigValue(
"COUCH_DB_URL",
`http://localhost:${global.__TESTCONTAINERS_DEVENV_PORT_5984__}`
)
overrideConfigValue(
"MINIO_URL",
`http://localhost:${global.__TESTCONTAINERS_DEVENV_PORT_9000__}`
)
overrideConfigValue("COUCH_DB_USERNAME", "admin")
overrideConfigValue("COUCH_DB_PASSWORD", "admin")