Fix qa-core teardown
This commit is contained in:
parent
b1287d6a9f
commit
25fc792d24
|
@ -59,9 +59,12 @@ export default class AccountAPI {
|
|||
return [response, json]
|
||||
}
|
||||
|
||||
async delete(accountID: string) {
|
||||
async delete(accountID: string, opts: APIRequestOpts = { doExpect: true }) {
|
||||
const [response, json] = await this.client.del(`/api/accounts/${accountID}`)
|
||||
expect(response).toHaveStatusCode(200)
|
||||
|
||||
if (opts.doExpect) {
|
||||
expect(response).toHaveStatusCode(200)
|
||||
}
|
||||
return response
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,7 +10,8 @@ const API_OPTS: APIRequestOpts = { doExpect: false }
|
|||
async function deleteAccount() {
|
||||
// @ts-ignore
|
||||
const accountID = global.qa.accountId
|
||||
await accountsApi.accounts.delete(accountID)
|
||||
// can't run 'expect' blocks in teardown
|
||||
await accountsApi.accounts.delete(accountID, { doExpect: false })
|
||||
}
|
||||
|
||||
async function teardown() {
|
||||
|
|
Loading…
Reference in New Issue