@swapper-finance/sdk
Version:
JavaScript SDK form Swapper
20 lines (15 loc) • 455 B
text/typescript
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);
});
});
});