w3cj / use-x

Practice implementing custom react hooks with full test suites and examples.
https://www.youtube.com/watch?v=GDXsuoisg60
MIT License
12 stars 4 forks source link
check-list custom-hooks hooks react react-fetch react-fetch-hooks react-test-suite test-suite usefetch

use-x

Practice implementing custom react hooks with full test suites and examples.

Hooks

Setup

Install dependencies

pnpm i

Enable tests

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