Practice implementing custom react hooks with full test suites and examples.
- useFetch
- Manage the error, loading and data state of
fetch
- Manage the error, loading and data state of
Install dependencies
pnpm i
All tests are skipped by default. To enable a test, remove .skip
- it.skip("should test the hook", async () => {
+ it("should test the hook", async () => {
// codes here
});
Run all tests
pnpm test
Run a specific test suite
pnpm test ./src/path/to/test/file/use-hook.test.ts