-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.js
More file actions
42 lines (41 loc) · 1.91 KB
/
Copy pathjest.config.js
File metadata and controls
42 lines (41 loc) · 1.91 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
// Must be set before babel-preset-expo transforms modules (it inlines
// EXPO_PUBLIC_* vars) — makes expo's winter runtime keep RN's fetch in tests.
process.env.EXPO_PUBLIC_USE_RN_FETCH = '1';
module.exports = {
preset: 'jest-expo',
// Reanimated v4 worklets: resolve to the non-native builds in Jest
resolver: 'react-native-worklets/jest/resolver.js',
setupFilesAfterEnv: ['<rootDir>/jest-setup.ts'],
testMatch: ['**/?(*.)+(spec|test).ts?(x)'],
testPathIgnorePatterns: ['<rootDir>/node_modules/', '\\.\\._.*'],
collectCoverage: true,
collectCoverageFrom: ['src/**/*.{ts,tsx}', '!**/coverage/**', '!**/node_modules/**', '!**/babel.config.js', '!**/jest.setup.js', '!**/docs/**', '!**/cli/**', '!**/ios/**', '!**/android/**', '!**/_*', '!**/._*'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
moduleDirectories: ['node_modules', '<rootDir>/'],
transformIgnorePatterns: [
'node_modules/(?!((jest-)?react-native|@react-native(-community)?|expo(nent)?|@expo(nent)?/.*|@expo-google-fonts/.*|react-navigation|@react-navigation/.*|standard-navigation|@rnmapbox|@sentry/react-native|native-base|react-native-svg|@legendapp/motion|@gluestack-ui|nativewind|react-native-css|expo-audio|@aptabase/.*|@shopify/flash-list))',
],
coverageReporters: ['json-summary', ['text', { file: 'coverage.txt' }], 'cobertura'],
reporters: [
'default',
['github-actions', { silent: false }],
'summary',
[
'jest-junit',
{
outputDirectory: 'coverage',
outputName: 'jest-junit.xml',
ancestorSeparator: ' › ',
uniqueOutputName: 'false',
suiteNameTemplate: '{filepath}',
classNameTemplate: '{classname}',
titleTemplate: '{title}',
},
],
],
coverageDirectory: '<rootDir>/coverage/',
moduleNameMapper: {
'\\.(css|less|scss|sass)$': '<rootDir>/__mocks__/styleMock.js',
'mapbox-gl': '<rootDir>/__mocks__/mapbox-gl.js',
},
};