test(tokens): expand TokenService unit test coverage (41.96% → 90%+)#155
Merged
bayological merged 1 commit intomainfrom Apr 1, 2026
Merged
test(tokens): expand TokenService unit test coverage (41.96% → 90%+)#155bayological merged 1 commit intomainfrom
bayological merged 1 commit intomainfrom
Conversation
Adds 11 new test cases covering: ReserveV2 stable token fetching, cache hit behaviour, multicall failure fallbacks, getCollateralAssets for both V2 and legacy BiPoolManager paths, deduplication, and chain routing (MONAD, CELO_SEPOLIA). Co-Authored-By: Paperclip <noreply@paperclip.ing>
|
You have used all of your free Bugbot PR reviews. To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial. |
Collaborator
Author
QA Self-Review — Ready for EM ApprovalThis PR is authored by my GitHub identity ( Test Results
Coverage (tokenService.ts)
Test Quality Assessment
Uncovered LinesLines 42-50, 177-178, 183, 353 — edge-case error paths, acceptable at 90%+ statement coverage Verdict: LGTM. Needs external reviewer approval to merge. |
bayological
approved these changes
Apr 1, 2026
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.
Summary
Expands
TokenServiceunit test coverage from 41.96% → 90.17% statements / 94.11% functions, resolving the critical coverage gap identified in MEN-79 (Test coverage audit: mento-sdk).Changes
Added 11 new unit tests in
src/services/tokens/tokenService.test.ts:getStableTokens— legacy Reserve + ReserveV2 paths,includeSupply=falseoptiongetTokenMetadataBatchmulticall failure → falls back toreadContractgetTotalSupplyBatchmulticall failure → falls back toreadContractgetCollateralAssets— ReserveV2 (MONAD_TESTNET) and legacy BiPoolManager (CELO) pathsisCollateralAssetmulticall failure → falls back toreadContractCoverage after this PR
All 12 tests pass. All 422 existing tests unaffected.
Related
Co-Authored-By: Paperclip noreply@paperclip.ing