mirror of
https://github.com/pezkuwichain/pwap.git
synced 2026-04-22 21:47:56 +00:00
fcfd126698
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>
36 lines
1.4 KiB
JavaScript
36 lines
1.4 KiB
JavaScript
module.exports = {
|
|
preset: 'jest-expo',
|
|
setupFiles: ['<rootDir>/jest.setup.before.cjs'],
|
|
setupFilesAfterEnv: ['<rootDir>/jest.setup.cjs'],
|
|
transformIgnorePatterns: [
|
|
'node_modules/(?!((jest-)?react-native|@react-native(-community)?)|expo(nent)?|@expo(nent)?/.*|@expo-google-fonts/.*|react-navigation|@react-navigation/.*|@unimodules/.*|unimodules|sentry-expo|native-base|react-native-svg|@polkadot/.*|@pezkuwi/.*|@babel/runtime)',
|
|
'!../shared/.*',
|
|
],
|
|
moduleNameMapper: {
|
|
'^@/(.*)$': '<rootDir>/src/$1',
|
|
'react-native-gesture-handler': '<rootDir>/__mocks__/react-native-gesture-handler.js',
|
|
'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: [
|
|
'src/**/*.{ts,tsx}',
|
|
'!src/**/*.d.ts',
|
|
'!src/**/__tests__/**',
|
|
'!src/**/types/**',
|
|
],
|
|
coverageThreshold: {
|
|
global: {
|
|
statements: 35,
|
|
branches: 20,
|
|
functions: 25,
|
|
lines: 35,
|
|
},
|
|
},
|
|
};
|