Repository navigation
Conversation
aazminu
force-pushed
the
fix-ci-default-checker-test-db-mock
branch
from
October 24, 2026 06:11
3f4b1f8 to
add2c72
Compare
Malware detection scan flagged this pull requestThe scan found 1 indicator(s) in the PR diff. This PR is blocked until a maintainer reviews the flagged files.
This is an automated triage signal; maintainers must verify whether the finding is malicious or intentional. |
aazminu
force-pushed
the
fix-ci-default-checker-test-db-mock
branch
2 times, most recently
from
October 24, 2026 06:58
4dea6b6 to
fe303ee
Compare
aazminu
force-pushed
the
fix-ci-default-checker-test-db-mock
branch
from
October 24, 2026 06:59
fe303ee to
9e1d701
Compare
This branch has not been deployed
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
Unblocks the
backendGitHub Actions CI job by mocking../db/connection.jsinbackend/src/__tests__/defaultChecker.test.ts.Root Cause
DefaultChecker.checkOverdueLoans()calls the module-levelbackfillExtensionDueLedgers()helper (backend/src/services/defaultChecker.ts:602), which executesquery(...)from../db/connection.jsbefore invokingthis.fetchOverdueStats(...). Whilebackend/src/services/__tests__/defaultChecker.test.tsmockeddb/connection.jsviajest.unstable_mockModule,backend/src/__tests__/defaultChecker.test.tsimportedDefaultCheckerdirectly without mocking../db/connection.js, causingnpm testin CI (which runs without a live PostgreSQL service on127.0.0.1:5432) to fail withconnect ECONNREFUSED 127.0.0.1:5432atbackfillExtensionDueLedgers.Changes
backend/src/__tests__/defaultChecker.test.ts:../db/connection.jsviajest.unstable_mockModuleprior to importing../services/defaultChecker.js, matchingbackend/src/services/__tests__/defaultChecker.test.ts.mockQueryinbeforeEachto resolve{ rows: [], rowCount: 0 }and assert thatbackfillExtensionDueLedgers'sLoanExtendedquery is invoked.Verification
node --experimental-vm-modules node_modules/jest/bin/jest.js src/__tests__/defaultChecker.test.ts src/services/__tests__/defaultChecker.test.ts --forceExit(2/2 suites, 19/19 tests pass)npx eslint src/__tests__/defaultChecker.test.ts(0 errors)npm run typecheck(0 errors)Payout / Reward Wallet
0x9a51790aC01c54184bcFa067bC38f7F0E7C6F6B6