Repository navigation
Expand file tree
/
Copy pathjest.config.js
More file actions
46 lines (45 loc) · 1.78 KB
/
Copy pathjest.config.js
File metadata and controls
46 lines (45 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
process.env.TZ = 'UTC';
module.exports = {
preset: 'react-native',
resolver: '<rootDir>/jest.resolver.js',
testEnvironment: '<rootDir>/jest-environment-react-native.js',
moduleFileExtensions: ['ts', 'tsx', 'js', 'mjs', 'jsx', 'json', 'node'],
// The zingolib submodule holds the Binding Layer's target and build
// directories, and no JavaScript, so the haste map skips it as Metro does.
modulePathIgnorePatterns: ['<rootDir>/.claude/', '<rootDir>/zingolib/'],
// visual/ holds Playwright specs, run by `yarn visual:capture`.
testPathIgnorePatterns: [
'/node_modules/',
'<rootDir>/visual/',
'<rootDir>/zingolib/',
],
// @noble/hashes, @react-navigation and zingolib-bundle-pin ship ESM only,
// so babel transforms them like React Native's own packages.
transformIgnorePatterns: [
'node_modules/(?!((jest-)?react-native|@react-native(-community)?|@react-navigation|@noble/hashes|zingolib-bundle-pin)/)',
],
transform: {
'\\.(mjs|[jt]sx?)$': 'babel-jest',
'^.+\\.(bmp|gif|jpg|jpeg|mp4|png|psd|webp)$':
'<rootDir>/node_modules/react-native/jest/assetFileTransformer.js',
},
moduleNameMapper: {
'\\.svg$': '<rootDir>/__mocks__/svgMock.js',
// See __mocks__/appTheme.ts
'^(\\.{1,2}/)+(app/)?theme$': '<rootDir>/__mocks__/appTheme.ts',
'^@app/theme$': '<rootDir>/__mocks__/appTheme.ts',
'^@app/(.*)$': '<rootDir>/app/$1',
'^@screens/(.*)$': '<rootDir>/screens/$1',
'^@ui/(.*)$': '<rootDir>/ui/$1',
},
setupFiles: ['./node_modules/react-native-gesture-handler/jestSetup.js'],
setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
coverageReporters: ['lcov', 'text'],
collectCoverageFrom: [
'app/**/*.{ts,tsx}',
'screens/**/*.{ts,tsx}',
'ui/**/*.{ts,tsx}',
'!**/__tests__/**',
'!**/node_modules/**',
],
};