1
0
Fork 0
mirror of synced 2024-07-09 00:06:05 +12:00

Merge pull request #10872 from Budibase/fix-qa-core-global-teardown

Fix qa-core global teardown
This commit is contained in:
Rory Powell 2023-06-12 15:09:26 +01:00 committed by GitHub
commit ea6e6d7c9d
2 changed files with 8 additions and 6 deletions

View file

@ -59,11 +59,13 @@ export default class AccountAPI {
return [response, json]
}
async delete(accountID: string, opts: APIRequestOpts = { doExpect: true }) {
const [response, json] = await this.client.del(`/api/accounts/${accountID}`)
if (opts.doExpect) {
expect(response).toHaveStatusCode(200)
async delete(accountID: string) {
const [response, json] = await this.client.del(`/api/accounts/${accountID}`, {
internal: true,
})
// can't use expect here due to use in global teardown
if (response.status !== 204) {
throw new Error(`Could not delete accountId=${accountID}`)
}
return response
}

View file

@ -11,7 +11,7 @@ async function deleteAccount() {
// @ts-ignore
const accountID = global.qa.accountId
// can't run 'expect' blocks in teardown
await accountsApi.accounts.delete(accountID, { doExpect: false })
await accountsApi.accounts.delete(accountID)
}
async function teardown() {