Created
June 27, 2019 13:48
-
-
Save andrecalvo/22d9f10dbd46d8fc1ab7585abb065d99 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import { useDataApi } from "path/to/hoo/useDataApi.jsx"; | |
import "whatwg-fetch"; | |
import { renderHook } from "@testing-library/react-hooks"; | |
import fetchMock from "fetch-mock"; | |
import { act } from "react-test-renderer"; | |
describe("useDataApi", () => { | |
beforeAll(() => { | |
global.fetch = fetch; | |
}); | |
afterAll(() => { | |
fetchMock.restore(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment