Repository navigation
Add API tests, extract client modules, add templates, and clean up console.error - #670
Merged
DeFiVC merged 5 commits intoOct 23, 2026
Conversation
❌ Deploy Preview for chainlearn failed.
|
Closes ChainLearnOfficial#538 - Add bug report and feature request issue templates - Add pull request template with summary, type, and testing checklist - Add CONTRIBUTING.md with setup, branch naming, commit conventions, and PR process
…o gitignore Closes ChainLearnOfficial#539 - Add test_output.log to .gitignore - Replace console.error calls with silent catches in hooks and components - Remove console.error from error-boundary and route-error - All production source files are now free of console.error
Closes ChainLearnOfficial#536 - Add auth.test.ts covering challenge, verify, profile, update, and refresh flows - Add rewards.test.ts covering balances, history, claim, and claimables - Add quizzes.test.ts covering quiz fetch, submission, and attempt history - Add vitest config and test script - All tests mock the API client (no real HTTP calls)
Closes ChainLearnOfficial#537 - Extract retry logic with exponential backoff into retry.ts - Extract LRU response caching into cache.ts - Extract request deduplication into dedup.ts - Re-export from client.ts so all existing imports continue to work - No behavioral changes to the API client
Clean up console.error calls in files added/modified upstream: - storage.ts, avatar-upload.tsx, use-notifications.ts, use-local-storage.ts - error-boundary.tsx, layout.tsx, wallet components, share-button.tsx - client.ts logging interceptor default - courses hooks, quiz-interface, credentials page
osasfaith
force-pushed
the
feat/api-improvements-and-docs
branch
from
October 23, 2026 19:32
405bd77 to
c361d10
Compare
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #536, Closes #537, Closes #538, Closes #539
Type of Change
Summary
This PR addresses four issues in a single set of incremental commits:
console.errorcalls from production source files (replaced with silent catches), addstest_output.logto.gitignore, and verifiescredentials.tsimports are clean.auth.ts,rewards.ts, andquizzes.tsAPI modules using vitest with mocked API client (success and error paths). Note:notifications.tsdoes not exist in the codebase.retry.ts), LRU caching (cache.ts), and request deduplication (dedup.ts) into focused, independently testable modules. Re-exports fromclient.tsso all existing imports continue to work with no behavioral changes.Motivation / Context
Untested API modules are prone to regression bugs.
console.errorin production leaks internal details. Missing templates increase maintainer review burden. A single-file API client is hard to navigate and test in isolation.Closes #536, Closes #537, Closes #538, Closes #539