56 lines
1.8 KiB
JavaScript
56 lines
1.8 KiB
JavaScript
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: ['<rootDir>/tests'],
|
|
testMatch: ['<rootDir>/tests/**/*.test.ts', '<rootDir>/tests/**/*.test.tsx'],
|
|
setupFiles: ['<rootDir>/tests/setup.ts'],
|
|
clearMocks: true,
|
|
moduleNameMapper: {
|
|
'^@/(.*)$': '<rootDir>/$1',
|
|
'^@backend/(.*)$': '<rootDir>/../backend/src/$1',
|
|
'^shared-types$': '<rootDir>/../shared-types',
|
|
'^@packages/shared$': '<rootDir>/../../packages/shared',
|
|
'^@packages/shared/(.*)$': '<rootDir>/../../packages/shared/$1',
|
|
'^global-shared$': '<rootDir>/../../packages/shared',
|
|
'^global-shared/(.*)$': '<rootDir>/../../packages/shared/$1',
|
|
'^common-ui$': '<rootDir>/../../packages/ui',
|
|
'^common-ui/(.*)$': '<rootDir>/../../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('|') +
|
|
'))',
|
|
],
|
|
}
|