Add moduleNameMapper for shared lib mocks in Jest

Create dedicated mock files for shared/lib modules and map them
in moduleNameMapper for reliable module resolution in CI.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-18 03:40:46 +03:00
parent e2127bb03e
commit 899d2a3b8b
4 changed files with 69 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
// Mock for shared/lib/scores.ts
module.exports = {
getTrustScore: jest.fn(() => Promise.resolve(0)),
getTrustScoreDetails: jest.fn(() => Promise.resolve(null)),
getReferralScore: jest.fn(() => Promise.resolve(0)),
getReferralCount: jest.fn(() => Promise.resolve(0)),
getStakingScoreFromPallet: jest.fn(() => Promise.resolve(0)),
getTikiScore: jest.fn(() => Promise.resolve(0)),
getAllScores: jest.fn(() =>
Promise.resolve({
trustScore: 0,
referralScore: 0,
stakingScore: 0,
tikiScore: 0,
totalScore: 0,
})
),
getScoreColor: jest.fn(() => '#22C55E'),
getScoreRating: jest.fn(() => 'Good'),
formatScore: jest.fn((score) => String(score)),
};