UNPKG

@gameye/sdk

Version:
35 lines 1.07 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const _1 = require("."); const clients_1 = require("../clients"); 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 _1.ApiTestServer.create({ token, keepAliveInterval, }); const endpoint = this.apiTestServer.getEndpoint(); this.gameyeClient = new clients_1.GameyeClient({ token, endpoint, }); } } TestContext.defaultConfig = Object.freeze({ keepAliveInterval: 1300, }); exports.TestContext = TestContext; //# sourceMappingURL=context.js.map