react-github-user-stats
Version:
Get Github user's stats using React Hooks.
14 lines (10 loc) • 331 B
text/typescript
import useGithubStats from "./index";
import { renderHook } from "@testing-library/react-hooks";
// mock timer using jest
jest.useFakeTimers();
describe("useGithubStats", () => {
it("updates every second", () => {
const { result } = renderHook(() => useGithubStats("munafio"));
expect(result).toBeDefined();
});
});