UNPKG

@xswap-link/sdk

Version:
21 lines (15 loc) 484 B
import fetchMock from "jest-fetch-mock"; import { getChains } from "../../src/services"; const chains = ["test", "test2", "test3", "test4"]; describe("API", () => { beforeEach(() => { fetchMock.resetMocks(); }); describe("getChains", () => { it("should return all supported chains", async () => { fetchMock.mockResponse(JSON.stringify(chains)); const supportedChains = await getChains(); expect(supportedChains).toHaveLength(4); }); }); });