Fix tests typing

This commit is contained in:
Adria Navarro 2023-12-04 09:23:01 +01:00
parent 188d5d09a2
commit 083ff0b7c7
1 changed files with 7 additions and 3 deletions

View File

@ -137,6 +137,10 @@ class TestConfiguration {
} }
getAppId() { getAppId() {
if (!this.appId) {
throw "appId has not been initialised properly"
}
return this.appId return this.appId
} }
@ -510,7 +514,7 @@ class TestConfiguration {
// create dev app // create dev app
// clear any old app // clear any old app
this.appId = null this.appId = null
this.app = await context.doInAppContext(null, async () => { this.app = await context.doInTenant(this.tenantId!, async () => {
const app = await this._req( const app = await this._req(
{ name: appName }, { name: appName },
null, null,
@ -519,7 +523,7 @@ class TestConfiguration {
this.appId = app.appId! this.appId = app.appId!
return app return app
}) })
return await context.doInAppContext(this.appId, async () => { return await context.doInAppContext(this.getAppId(), async () => {
// create production app // create production app
this.prodApp = await this.publish() this.prodApp = await this.publish()
@ -817,7 +821,7 @@ class TestConfiguration {
} }
async getAutomationLogs() { async getAutomationLogs() {
return context.doInAppContext(this.appId, async () => { return context.doInAppContext(this.getAppId(), async () => {
const now = new Date() const now = new Date()
return await pro.sdk.automations.logs.logSearch({ return await pro.sdk.automations.logs.logSearch({
startDate: new Date(now.getTime() - 100000).toISOString(), startDate: new Date(now.getTime() - 100000).toISOString(),