@mytmpvpn/mytmpvpn-client
Version:
MyTmpVpn Client Library
27 lines (26 loc) • 1.27 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const appconfig = require("../src/appconfig");
const common_1 = require("./common");
describe('Testing getConfig APIs', () => {
var client;
const appConfig = appconfig.loadDefaultAppConfig();
const userProfile = (0, common_1.createUserProfile)();
beforeAll(async () => {
client = await (0, common_1.createAuthUser)(appConfig, userProfile);
}, 600000);
afterAll(async () => {
await (0, common_1.deleteCleanUpAllAndDeleteAuthUser)(client, appConfig, userProfile);
}, 600000);
it("should return the configuration of a running vpn from a (userId, vpnId)", async () => {
const vpnConfig = (0, common_1.getGoodPeanutsConfig)(await client.getVpnConfigLimits());
const vpn = await client.createVpnSync(common_1.VPN_REGION, vpnConfig);
expect(vpn).toBeDefined();
expect(vpn.vpnId).toBeDefined();
const getVpnConfigResponse = await client.getVpnConfig(vpn.vpnId);
expect(getVpnConfigResponse).toBeDefined();
const getVpnQrConfigResponse = await client.getVpnQrConfig(vpn.vpnId);
expect(getVpnQrConfigResponse).toBeDefined();
await (0, common_1.cleanUp)(client, vpn);
});
});