mirror of
https://github.com/pezkuwichain/pwap.git
synced 2026-06-13 18:11:00 +00:00
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:
@@ -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)),
|
||||
};
|
||||
Reference in New Issue
Block a user