📌 Description
The project uses Vitest, React Testing Library, happy-dom, and v8 coverage, but
there is no guide documenting how to write tests, mock fetch/Freighter, use
fake timers, or run coverage. Contributors writing the many new test files in
this campaign need a consistent reference.
This issue adds a frontend testing guide capturing the project's conventions and
common mocking patterns.
🎯 Requirements and Context
- Document running tests (
pnpm test, test:watch, test:coverage) and the
coverage threshold expectation.
- Show patterns: mocking
fetch, mocking @stellar/freighter-api, fake timers,
and RTL queries/accessibility-first assertions.
- Document conventions for
__tests__ placement and naming.
- Provide a copy-paste component-test and route-test template.
🛠️ Suggested Execution
1. Fork the repo and create a branch
git checkout -b docs/frontend-testing-guide
2. Implement changes
- Add
docs/TESTING_GUIDE.md; cross-link from README.md and DEVELOPER_GUIDE.md.
- Add
src/lib/__tests__/testingGuideExamples.test.ts that runs the guide's
example snippets so they cannot rot.
- Validate the example tests pass under the real test runner.
3. Test and commit
- Run
pnpm test.
- Cover edge cases: ensure example mocks (fetch/Freighter/timers) actually work.
Example commit message
docs: frontend testing guide with Vitest/RTL conventions
✅ Guidelines
- Minimum 95% test coverage on example helpers.
- Clear, reviewer-friendly documentation.
- Timeframe: 96 hours.
🏷️ Labels
type-documentation · area-frontend · MAYBE REWARDED · GRANTFOX OSS ·
OFFICIAL CAMPAIGN
💬 Community & Support
- Join the CommitLabs contributor Discord to coordinate and get unblocked fast:
https://discord.gg/WV7tdYkJk
- Introduce yourself before starting so we can avoid duplicate work and pair you
with a reviewer. Maintainers triage actively and review fast.
📌 Description
The project uses Vitest, React Testing Library, happy-dom, and v8 coverage, but
there is no guide documenting how to write tests, mock
fetch/Freighter, usefake timers, or run coverage. Contributors writing the many new test files in
this campaign need a consistent reference.
This issue adds a frontend testing guide capturing the project's conventions and
common mocking patterns.
🎯 Requirements and Context
pnpm test,test:watch,test:coverage) and thecoverage threshold expectation.
fetch, mocking@stellar/freighter-api, fake timers,and RTL queries/accessibility-first assertions.
__tests__placement and naming.🛠️ Suggested Execution
1. Fork the repo and create a branch
2. Implement changes
docs/TESTING_GUIDE.md; cross-link fromREADME.mdandDEVELOPER_GUIDE.md.src/lib/__tests__/testingGuideExamples.test.tsthat runs the guide'sexample snippets so they cannot rot.
3. Test and commit
pnpm test.Example commit message
✅ Guidelines
🏷️ Labels
type-documentation·area-frontend·MAYBE REWARDED·GRANTFOX OSS·OFFICIAL CAMPAIGN💬 Community & Support
https://discord.gg/WV7tdYkJk
with a reviewer. Maintainers triage actively and review fast.