forked from MetaMask/metamask-mobile
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
44 lines (40 loc) · 1.69 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
process.env.TZ = 'America/Toronto';
process.env.MM_BLOCKAID_UI_ENABLED = 'true';
process.env.SEGMENT_DELETE_API_SOURCE_ID = 'testSourceId';
process.env.SEGMENT_REGULATIONS_ENDPOINT = 'TestRegulationsEndpoint';
process.env.MM_FOX_CODE = 'EXAMPLE_FOX_CODE';
const config = {
preset: 'react-native',
setupFilesAfterEnv: ['<rootDir>/app/util/test/testSetup.js'],
testEnvironment: 'jest-environment-node',
transformIgnorePatterns: [
'node_modules/(?!((@metamask/)?(@react-native|react-native|redux-persist-filesystem|@react-navigation|@react-native-community|@react-native-masked-view|react-navigation|react-navigation-redux-helpers|@sentry|d3-color|@notifee)))',
],
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',
collectCoverageFrom: ['<rootDir>/app/**/*.{js,ts,tsx,jsx}'],
coveragePathIgnorePatterns: [
'__mocks__/',
'<rootDir>/app/util/test/',
'<rootDir>/app/util/testUtils/',
'<rootDir>/app/lib/ppom/ppom.html.js',
'<rootDir>/app/lib/ppom/blockaid-version.js',
],
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',
},
// Disable jest cache
cache: false,
};
// eslint-disable-next-line import/no-commonjs
module.exports = config;