Contributor Guidelines
Is your feature request related to a problem? Please describe.
The entire codebase has only 2 unit test files (both in src/plays/savings-calculator/). Critical infrastructure like custom hooks, utility functions, service layers, and the search/filter system have zero test coverage. The testing framework (Jest + React Testing Library) is properly configured but barely utilized.
Describe the solution you'd like.
- Write unit tests for all custom hooks using
@testing-library/react-hooks
- Write unit tests for utility functions (
commonUtils.js, formatCount.ts, coverImageUtil.js)
- Write tests for the search query parser (
search-helper.js → ParseQuery, QueryDBTranslator)
- Write integration tests for service functions with mocked GraphQL responses
- Establish a test coverage threshold (e.g., 60% for
src/common/) in CI
Affected Files:
src/common/hooks/useFetch.js — no tests
src/common/hooks/useCacheResponse.ts — no tests
src/common/hooks/useContributors.js — no tests
src/common/hooks/useFeaturedPlays.js — no tests
src/common/hooks/useGitHub.js — no tests
src/common/hooks/useLikePlays.js — no tests
src/common/hooks/useLocalStorage.js — no tests
src/common/utils/commonUtils.js — no tests
src/common/utils/formatCount.ts — no tests
src/common/services/plays.js — no tests
src/common/search/search-helper.js — no tests
Describe alternatives you've considered.
No alternative required
Screenshot / Screenshare
No response
Additional context
No response
Record
Code of Conduct
Contributor Guidelines
Is your feature request related to a problem? Please describe.
The entire codebase has only 2 unit test files (both in
src/plays/savings-calculator/). Critical infrastructure like custom hooks, utility functions, service layers, and the search/filter system have zero test coverage. The testing framework (Jest + React Testing Library) is properly configured but barely utilized.Describe the solution you'd like.
@testing-library/react-hookscommonUtils.js,formatCount.ts,coverImageUtil.js)search-helper.js→ParseQuery,QueryDBTranslator)src/common/) in CIAffected Files:
src/common/hooks/useFetch.js— no testssrc/common/hooks/useCacheResponse.ts— no testssrc/common/hooks/useContributors.js— no testssrc/common/hooks/useFeaturedPlays.js— no testssrc/common/hooks/useGitHub.js— no testssrc/common/hooks/useLikePlays.js— no testssrc/common/hooks/useLocalStorage.js— no testssrc/common/utils/commonUtils.js— no testssrc/common/utils/formatCount.ts— no testssrc/common/services/plays.js— no testssrc/common/search/search-helper.js— no testsDescribe alternatives you've considered.
No alternative required
Screenshot / Screenshare
No response
Additional context
No response
Record
Code of Conduct