Expose beforeall error

This commit is contained in:
adrinr 2023-01-31 11:48:58 +00:00
parent dd2a05fdcb
commit 9c04ae5f85
1 changed files with 12 additions and 8 deletions

View File

@ -135,16 +135,20 @@ class TestConfiguration {
// SETUP / TEARDOWN
async beforeAll() {
this.#tenantId = `tenant-${utils.newid()}`
try {
this.#tenantId = `tenant-${utils.newid()}`
// Running tests in parallel causes issues creating the globaldb twice. This ensures the db is properly created before starting
await retry(async () => await this.createDefaultUser())
await this.createSession(this.defaultUser!)
// Running tests in parallel causes issues creating the globaldb twice. This ensures the db is properly created before starting
await retry(async () => await this.createDefaultUser())
await this.createSession(this.defaultUser!)
await tenancy.doInTenant(this.#tenantId, async () => {
await this.createTenant1User()
await this.createSession(this.tenant1User!)
})
await tenancy.doInTenant(this.#tenantId, async () => {
await this.createTenant1User()
await this.createSession(this.tenant1User!)
})
} catch (e: any) {
throw new Error(e.message)
}
}
async afterAll() {