@ledgerhq/ledger-cal-service
Version:
Ledger CAL service client
36 lines • 1.35 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const common_1 = require("./common");
const networks_1 = require("./networks");
describe("getNetworks", () => {
it("returns all networks information", async () => {
// Given
const CAL_STAGING_NETWORKS_MANAGED_NUM = 275;
// When
const result = await (0, networks_1.getNetworks)(null, common_1.STAGING_ENV);
// Then
expect(result).toHaveLength(CAL_STAGING_NETWORKS_MANAGED_NUM);
});
it("returns networks information for ethereum blockchain", async () => {
// When
const result = await (0, networks_1.getNetworks)("ethereum", common_1.STAGING_ENV);
// Then
expect(result).toHaveLength(1);
expect(result[0]).toEqual({
appName: "Ethereum",
chainId: 1,
coin: "ethereum",
coinType: 60,
family: "ethereum",
id: "ethereum",
name: "Ethereum",
networkType: "main",
tokenStandard: "erc20",
});
});
it("returns an error if the id is incorrect", async () => {
// When
await expect((0, networks_1.getNetworks)("WRONG", common_1.STAGING_ENV)).rejects.toEqual(new networks_1.NoNetworksFound());
});
});
//# sourceMappingURL=networks.integ.test.js.map