1
0
Fork 0
mirror of synced 2024-06-26 18:10:51 +12:00

use environment variables in jest run

This commit is contained in:
Martin McKeaveney 2022-09-28 18:31:23 +01:00
parent 20ae838475
commit 943bd54879
3 changed files with 6 additions and 9 deletions

View file

@ -9,8 +9,8 @@
"url": "https://github.com/Budibase/budibase.git"
},
"scripts": {
"test": "jest --runInBand",
"test:watch": "jest --watch",
"test": "env-cmd jest --runInBand",
"test:watch": "env-cmd jest --watch",
"test:debug": "DEBUG=1 jest",
"docker:up": "docker-compose up -d",
"docker:down": "docker-compose down",
@ -53,4 +53,4 @@
"@budibase/backend-core": "^2.0.5",
"node-fetch": "2"
}
}
}

View file

@ -12,7 +12,6 @@ interface ApiOptions {
class InternalAPIClient {
host: string
appId?: string
csrfToken?: string
cookie?: string
constructor(appId?: string) {

View file

@ -11,10 +11,8 @@ export default class AuthApi {
async login(): Promise<[Response, any]> {
const response = await this.api.post(`/global/auth/default/login`, {
body: {
// username: process.env.BB_ADMIN_USER_EMAIL,
// password: process.env.BB_ADMIN_USER_PASSWORD
username: "qa@budibase.com",
password: "budibase"
username: process.env.BB_ADMIN_USER_EMAIL,
password: process.env.BB_ADMIN_USER_PASSWORD
}
})
const cookie = response.headers.get("set-cookie")
@ -23,6 +21,6 @@ export default class AuthApi {
}
async logout(): Promise<any> {
return this.api.post(`/global/auth/default/logout`)
return this.api.post(`/global/auth/logout`)
}
}