UNPKG

@gameye/sdk

Version:
32 lines 963 B
import { ApiTestServer } from "."; import { GameyeClient } from "../clients"; export class TestContext { constructor(config = {}) { this.config = Object.freeze(Object.assign({}, TestContext.defaultConfig, config)); } static async create(config = {}) { const instance = new this(config); await instance.initialize(); return instance; } async destroy() { await this.apiTestServer.destroy(); } async initialize() { const { keepAliveInterval } = this.config; const token = "testing"; this.apiTestServer = await ApiTestServer.create({ token, keepAliveInterval, }); const endpoint = this.apiTestServer.getEndpoint(); this.gameyeClient = new GameyeClient({ token, endpoint, }); } } TestContext.defaultConfig = Object.freeze({ keepAliveInterval: 1300, }); //# sourceMappingURL=context.js.map