UNPKG

@swapper-finance/sdk

Version:
20 lines (15 loc) 455 B
import fetch from "jest-fetch-mock"; import { chains } from "./api.mock"; import { getChains } from "@src/services"; describe("API", () => { beforeEach(() => { fetch.resetMocks(); }); describe("getChains", () => { it("should return all supported chains", async () => { fetch.mockResponseOnce(JSON.stringify(chains)); const supportedChains = await getChains(); expect(supportedChains).toHaveLength(4); }); }); });