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 b8b5addf0e
commit fcfd126698
4 changed files with 69 additions and 0 deletions
+4
View File
@@ -12,6 +12,10 @@ module.exports = {
'react-native-reanimated': '<rootDir>/__mocks__/react-native-reanimated.js',
'^sonner$': '<rootDir>/__mocks__/sonner.js',
'@polkadot/extension-dapp': '<rootDir>/__mocks__/polkadot-extension-dapp.js',
// Mock shared lib modules that depend on @pezkuwi/api
'^.*/shared/lib/tiki$': '<rootDir>/__mocks__/shared-lib-tiki.js',
'^.*/shared/lib/referral$': '<rootDir>/__mocks__/shared-lib-referral.js',
'^.*/shared/lib/scores$': '<rootDir>/__mocks__/shared-lib-scores.js',
},
testMatch: ['**/__tests__/**/*.test.(ts|tsx|js)'],
collectCoverageFrom: [