UNPKG

@mytmpvpn/mytmpvpn-client

Version:

MyTmpVpn Client Library

30 lines (29 loc) 1.36 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const appconfig = require("../src/appconfig"); const src_1 = require("../src"); describe('Testing regions related APIs', () => { const appConfig = appconfig.loadDefaultAppConfig(); const client = (0, src_1.getClientModule)(appConfig.apiUrl); it("should list all regions, concise", async () => { const regions = await client.listRegions(); expect(regions).toBeDefined(); // dev, gamma, prod all have more than 3 regions expect(Object.keys(regions).length).toBeGreaterThanOrEqual(3); expect(regions[0]).toBeDefined(); expect(regions[0].length).toBeGreaterThan(0); }); it("should list all regions, detailed", async () => { const regions = await client.listRegionsDetailed(); expect(regions).toBeDefined(); // dev, gamma, prod all have more than 3 regions expect(Object.keys(regions).length).toBeGreaterThanOrEqual(3); regions.forEach(regionInfo => { expect(regionInfo).toBeDefined(); expect(regionInfo.name.length).toBeGreaterThan(0); expect(regionInfo.city.length).toBeGreaterThan(0); expect(regionInfo.country.length).toBeGreaterThan(0); expect(regionInfo.cctld.length).toBeGreaterThan(0); }); }); });