UNPKG

@ledgerhq/coin-tron

Version:
19 lines 761 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const lastBlock_1 = require("./lastBlock"); const network_1 = require("../network"); jest.mock("../network"); describe("lastBlock", () => { it("should return the last block info", async () => { const mockBlockInfo = { hash: "0000000000000000000a8edc8b8f8b8f8b8f8b8f8b8f8b8f8b8f8b8f8b8f8b8", height: 123456, time: new Date(1617181723), }; network_1.getLastBlock.mockResolvedValue(mockBlockInfo); const result = await (0, lastBlock_1.lastBlock)(); expect(result).toEqual(mockBlockInfo); expect(network_1.getLastBlock).toHaveBeenCalledTimes(1); }); }); //# sourceMappingURL=lastBlock.test.js.map