1
0
Fork 0
mirror of synced 2024-05-16 10:23:13 +12:00
budibase/qa-core/src/account-api/config/TestConfiguration.ts
Mitch-Budibase ecf75a9685 lint
2023-07-19 15:42:12 +01:00

30 lines
617 B
TypeScript

import { AccountInternalAPI } from "../api"
import { BudibaseTestConfiguration } from "../../shared"
export default class TestConfiguration<T> extends BudibaseTestConfiguration {
// apis
api: AccountInternalAPI
context: T
constructor() {
super()
this.api = new AccountInternalAPI(this.state)
this.context = <T>{}
}
async beforeAll() {
await super.beforeAll()
await this.setApiKey()
}
async afterAll() {
await super.afterAll()
}
async setApiKey() {
const apiKeyResponse = await this.internalApi.self.getApiKey()
this.state.apiKey = apiKeyResponse.apiKey
}
}