@ledgerhq/coin-tron
Version:
Ledger Tron Coin integration
17 lines • 646 B
JavaScript
import { lastBlock } from "./lastBlock";
import { getLastBlock } from "../network";
jest.mock("../network");
describe("lastBlock", () => {
it("should return the last block info", async () => {
const mockBlockInfo = {
hash: "0000000000000000000a8edc8b8f8b8f8b8f8b8f8b8f8b8f8b8f8b8f8b8f8b8",
height: 123456,
time: new Date(1617181723),
};
getLastBlock.mockResolvedValue(mockBlockInfo);
const result = await lastBlock();
expect(result).toEqual(mockBlockInfo);
expect(getLastBlock).toHaveBeenCalledTimes(1);
});
});
//# sourceMappingURL=lastBlock.test.js.map