-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjest.config.js
More file actions
39 lines (37 loc) · 1.32 KB
/
jest.config.js
File metadata and controls
39 lines (37 loc) · 1.32 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
const preset = require('react-native/jest-preset');
module.exports = {
...preset,
setupFiles: [
...(preset.setupFiles || []),
'<rootDir>/node_modules/react-native-gesture-handler/jestSetup.js',
],
setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
transformIgnorePatterns: [
'node_modules/(?!(jest-)?react-native|@react-native|@react-navigation|@expo|expo(-.*)?|expo-modules-core|expo-router|@expo-google-fonts|@unimodules|react-native-svg|react-native-reanimated|@shopify/flash-list)',
],
moduleNameMapper: {
...(preset.moduleNameMapper || {}),
'^@/(.*)$': '<rootDir>/$1',
// Mock binary assets
'\\.(ttf|otf|eot|woff|woff2)$': '<rootDir>/__mocks__/fileMock.js',
'\\.(jpg|jpeg|png|gif|svg|webp)$': '<rootDir>/__mocks__/fileMock.js',
},
testPathIgnorePatterns: ['/node_modules/', '/android/', '/ios/'],
// Coverage configuration
collectCoverageFrom: [
'app/**/*.{ts,tsx}',
'components/**/*.{ts,tsx}',
'hooks/**/*.{ts,tsx}',
'services/**/*.{ts,tsx}',
'utils/**/*.{ts,tsx}',
'constants/**/*.{ts,tsx}',
'!**/*.d.ts',
'!**/node_modules/**',
'!**/__tests__/**',
'!**/__mocks__/**',
'!**/coverage/**',
'!app/**/_layout.tsx',
],
coverageReporters: ['text', 'text-summary', 'lcov', 'json-summary', 'html'],
coverageDirectory: '<rootDir>/coverage',
};