Playing around with getting tests working.
This commit is contained in:
parent
a83eb00872
commit
ea5b515783
|
@ -7,11 +7,11 @@ const dbList = new Set()
|
|||
|
||||
export function getDB(dbName?: string, opts?: any): Database {
|
||||
// TODO: once using the test image, need to remove this
|
||||
if (env.isTest()) {
|
||||
dbList.add(dbName)
|
||||
// @ts-ignore
|
||||
return getPouchDB(dbName, opts)
|
||||
}
|
||||
// if (env.isTest()) {
|
||||
// dbList.add(dbName)
|
||||
// // @ts-ignore
|
||||
// return getPouchDB(dbName, opts)
|
||||
// }
|
||||
return new DatabaseImpl(dbName, opts)
|
||||
}
|
||||
|
||||
|
|
|
@ -11,6 +11,8 @@ env._set("PORT", 0)
|
|||
env._set("MINIO_URL", "http://localhost")
|
||||
env._set("MINIO_ACCESS_KEY", "test")
|
||||
env._set("MINIO_SECRET_KEY", "test")
|
||||
env._set("COUCH_DB_USER", "budibase")
|
||||
env._set("COUCH_DB_PASSWORD", "budibase")
|
||||
|
||||
import { mocks } from "@budibase/backend-core/tests"
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import env from "../environment"
|
||||
import { env as coreEnv } from "@budibase/backend-core"
|
||||
|
||||
env._set("SELF_HOSTED", "0")
|
||||
env._set("NODE_ENV", "jest")
|
||||
|
@ -11,6 +12,8 @@ env._set("MINIO_SECRET_KEY", "test")
|
|||
env._set("PLATFORM_URL", "http://localhost:10000")
|
||||
env._set("INTERNAL_API_KEY", "test")
|
||||
env._set("DISABLE_ACCOUNT_PORTAL", false)
|
||||
coreEnv._set("COUCH_DB_USER", "budibase")
|
||||
coreEnv._set("COUCH_DB_PASSWORD", "budibase")
|
||||
|
||||
import { mocks } from "@budibase/backend-core/tests"
|
||||
|
||||
|
|
Loading…
Reference in New Issue