forked from MetaMask/metamask-mobile
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
28 lines (26 loc) · 1.18 KB
/
jest.config.js
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
process.env.TZ = 'America/Toronto';
const config = {
preset: 'react-native',
setupFilesAfterEnv: ['<rootDir>/app/util/test/testSetup.js'],
transformIgnorePatterns: [
'node_modules/(?!(@react-native|react-native|rn-fetch|redux-persist-filesystem|@react-navigation|@react-native-community|@react-native-masked-view|react-navigation|react-navigation-redux-helpers|@sentry|d3-color))',
],
transform: {
'^.+\\.[jt]sx?$': 'babel-jest',
'^.+\\.(png|jpg|jpeg|gif|webp|svg|mp4)$':
'<rootDir>/app/util/test/assetFileTransformer.js',
},
snapshotSerializers: ['enzyme-to-json/serializer'],
// This is an environment variable that can be used to execute logic only in development
collectCoverage: process.env.NODE_ENV !== 'production',
coveragePathIgnorePatterns: ['/node_modules/', '__mocks__', '<rootDir>/e2e/'],
coverageReporters: ['text-summary', 'lcov'],
coverageDirectory: '<rootDir>/tests/coverage',
maxWorkers: process.env.NODE_ENV === 'production' ? '50%' : '20%',
moduleNameMapper: {
'\\.svg': '<rootDir>/app/__mocks__/svgMock.js',
'\\.png': '<rootDir>/app/__mocks__/pngMock.js',
},
};
// eslint-disable-next-line import/no-commonjs
module.exports = config;