fix(ci): green typecheck + tests (mock completeness + real remittance-auth/rbac bug fixes)#45
Merged
Merged
Conversation
…cks to green typecheck+test
…solate assertion from inherited testnet STELLAR_RPC_URL
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.
What
Finishes unbreaking
remitlend-backendmain CI. #44 fixed the Lint/format/build steps; this fixes the remaining two red steps — typecheck (78 errors) and test (5 crashing suites) — so the fullbuild-and-testjob is green.CI fixes
../db/connection.jsmock factories in 5 suites (score/auth/adminDispute/notification/remittance controllers) were missing exports that transitively-imported modules use, crashing withdoes not provide an export named 'getClient'. AddedgetClient,withTransaction(working callback impl), andpool.nevererrors (78) — untypedjest.fn()mocks inferneverargs. Typed the recurring offenders with explicit generics (no@ts-ignore).Real product bugs the now-running tests exposed (fixed at source)
remittanceControllerreadreq.walletAddress(never set by any middleware) instead ofreq.user.publicKey, so every authenticated remittance request 401'd. Fixed all 4 occurrences.rbac.ts: no role grantedread:remittances/write:remittances, so remittance routes were unreachable (403). Added both to theborrowerrole.notificationController.markRead: accepted an emptyids: []as success; now 400s (matches documented intent).DISABLE_RATE_LIMITused only by the login-flood test; limiter stays fully active by default (auth.test.ts 429 assertions still pass).Remaining test tweaks align stale expectations to the current implementation (score bands, breakdown response shape, SSE stream handling). No assertions weakened just to pass.
Verified green (locally)
typecheck exit 0 · test 47 suites / 464 pass / 0 fail · lint exit 0 · build exit 0 ·
prettier --check .pass.