const path = require('path') const appRoot = path.resolve(__dirname, '..') /** * Jest project for apps/user-ui integration tests. * * Kept out of the app build three ways: * 1. .easignore (tests/ never uploaded to EAS) * 2. metro.config.js resolver.blockList (never bundled) * 3. tsconfig.json exclude + tests/tsconfig.json (separate typecheck scope) */ module.exports = { preset: 'jest-expo', rootDir: appRoot, roots: ['/tests'], testMatch: ['/tests/**/*.test.ts', '/tests/**/*.test.tsx'], setupFiles: ['/tests/setup.ts'], clearMocks: true, moduleNameMapper: { '^@/(.*)$': '/$1', '^@backend/(.*)$': '/../backend/src/$1', '^shared-types$': '/../shared-types', '^@packages/shared$': '/../../packages/shared', '^@packages/shared/(.*)$': '/../../packages/shared/$1', '^global-shared$': '/../../packages/shared', '^global-shared/(.*)$': '/../../packages/shared/$1', '^common-ui$': '/../../packages/ui', '^common-ui/(.*)$': '/../../packages/ui/$1', }, transformIgnorePatterns: [ 'node_modules/(?!(?:.pnpm/)?(' + [ '(jest-)?react-native', '@react-native(-community)?', 'expo(nent)?', '@expo(nent)?/.*', '@expo-google-fonts/.*', 'react-navigation', '@react-navigation/.*', '@sentry/react-native', 'native-base', 'react-native-svg', 'react-native-gesture-handler', 'react-native-reanimated', 'react-native-safe-area-context', 'react-native-screens', '@trpc/.*', '@tanstack/.*', 'twrnc', 'zod', '@testing-library/react-native', ].join('|') + '))', ], }