Delete apps on end

This commit is contained in:
Adria Navarro 2023-01-17 10:28:51 +00:00
parent eedc49de14
commit da8f7eff6c
1 changed files with 12 additions and 5 deletions

View File

@ -137,21 +137,28 @@ class TestConfiguration {
return this.createApp(appName)
}
end() {
async end() {
if (!this) {
return
}
if (this.server) {
this.server.close()
}
if (this.allApps) {
cleanup(this.allApps.map(app => app.appId))
await this._req(
null,
{ appId: this.prodApp.appId },
controllers.app.destroy
)
}
if (this.server) {
this.server.close()
}
}
// UTILS
async _req(body: any, params: any, controlFunc: any) {
_req(body: any, params: any, controlFunc: any) {
// create a fake request ctx
const request: any = {}
const appId = this.appId