use environment variables in jest run
This commit is contained in:
parent
20ae838475
commit
943bd54879
|
@ -9,8 +9,8 @@
|
||||||
"url": "https://github.com/Budibase/budibase.git"
|
"url": "https://github.com/Budibase/budibase.git"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "jest --runInBand",
|
"test": "env-cmd jest --runInBand",
|
||||||
"test:watch": "jest --watch",
|
"test:watch": "env-cmd jest --watch",
|
||||||
"test:debug": "DEBUG=1 jest",
|
"test:debug": "DEBUG=1 jest",
|
||||||
"docker:up": "docker-compose up -d",
|
"docker:up": "docker-compose up -d",
|
||||||
"docker:down": "docker-compose down",
|
"docker:down": "docker-compose down",
|
||||||
|
@ -53,4 +53,4 @@
|
||||||
"@budibase/backend-core": "^2.0.5",
|
"@budibase/backend-core": "^2.0.5",
|
||||||
"node-fetch": "2"
|
"node-fetch": "2"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -12,7 +12,6 @@ interface ApiOptions {
|
||||||
class InternalAPIClient {
|
class InternalAPIClient {
|
||||||
host: string
|
host: string
|
||||||
appId?: string
|
appId?: string
|
||||||
csrfToken?: string
|
|
||||||
cookie?: string
|
cookie?: string
|
||||||
|
|
||||||
constructor(appId?: string) {
|
constructor(appId?: string) {
|
||||||
|
|
|
@ -11,10 +11,8 @@ export default class AuthApi {
|
||||||
async login(): Promise<[Response, any]> {
|
async login(): Promise<[Response, any]> {
|
||||||
const response = await this.api.post(`/global/auth/default/login`, {
|
const response = await this.api.post(`/global/auth/default/login`, {
|
||||||
body: {
|
body: {
|
||||||
// username: process.env.BB_ADMIN_USER_EMAIL,
|
username: process.env.BB_ADMIN_USER_EMAIL,
|
||||||
// password: process.env.BB_ADMIN_USER_PASSWORD
|
password: process.env.BB_ADMIN_USER_PASSWORD
|
||||||
username: "qa@budibase.com",
|
|
||||||
password: "budibase"
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const cookie = response.headers.get("set-cookie")
|
const cookie = response.headers.get("set-cookie")
|
||||||
|
@ -23,6 +21,6 @@ export default class AuthApi {
|
||||||
}
|
}
|
||||||
|
|
||||||
async logout(): Promise<any> {
|
async logout(): Promise<any> {
|
||||||
return this.api.post(`/global/auth/default/logout`)
|
return this.api.post(`/global/auth/logout`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue