Skip to content

feat(hooks): Configure Jest and add unit tests for useFetchStories#11

Open
wejdenemk wants to merge 2 commits intoAndreaGriffiths11:mainfrom
wejdenemk:feat/IntegrateUnitTeests
Open

feat(hooks): Configure Jest and add unit tests for useFetchStories#11
wejdenemk wants to merge 2 commits intoAndreaGriffiths11:mainfrom
wejdenemk:feat/IntegrateUnitTeests

Conversation

@wejdenemk
Copy link
Copy Markdown

feat(hooks): add unit tests for useFetchStories; configure Jest (React 19)

  • Add comprehensive tests for caching, ETag/304 handling, sorting, and error fallback
  • Configure Jest with ts-jest preset and jsdom environment (jest.config.ts)
  • Add test setup (jest.setup.ts) with @testing-library/jest-dom and fetch polyfill
  • Update package.json with test scripts (test, test:watch)
  • Add dev deps: jest, ts-jest, jest-environment-jsdom, @testing-library/react, @testing-library/jest-dom, @types/jest, whatwg-fetch, ts-node

How to run:

  • npm i
  • npm test -- --coverage

Closes #10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add unit tests for useFetchStories hook

1 participant