forked from celo-org/celo-monorepo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
46 lines (45 loc) · 1.61 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
45
46
const reactNativeJestPreset = require('react-native/jest-preset')
const { defaults: tsjPreset } = require('ts-jest/presets')
const { nodeFlakeTracking } = require('@celo/flake-tracker/src/jest/config.js')
module.exports = {
...tsjPreset,
globals: {
navigator: true,
'ts-jest': {
babelConfig: true,
// Disables type-check when running tests as it takes valuable time
// and is redundant with the tsc build step
isolatedModules: true,
tsConfig: 'tsconfig.test.json',
},
window: true,
},
haste: {
...reactNativeJestPreset.haste,
defaultPlatform: 'android',
},
moduleNameMapper: {
'@celo/mobile': '<rootDir>',
'^crypto-js$': '<rootDir>/../../node_modules/crypto-js',
'react-native-svg': '<rootDir>/../../node_modules/react-native-svg-mock',
},
modulePathIgnorePatterns: ['<rootDir>/node_modules/(.*)/node_modules/react-native'],
preset: 'react-native',
...nodeFlakeTracking,
setupFilesAfterEnv: [
'<rootDir>/jest_setup.ts',
'<rootDir>/../../node_modules/react-native-gesture-handler/jestSetup.js',
...nodeFlakeTracking.setupFilesAfterEnv,
],
testPathIgnorePatterns: ['/node_modules/', '<rootDir>/e2e'],
transform: {
...tsjPreset.transform,
'\\.js$': '<rootDir>/../../node_modules/react-native/jest/preprocessor.js',
'^.+\\.(txt)$': require.resolve(
'<rootDir>/../../node_modules/react-native/jest/assetFileTransformer.js'
),
},
transformIgnorePatterns: [
'node_modules/(?!(@celo/)?react-native|@react-navigation|@react-native-community|@react-native-firebase|react-navigation|redux-persist|date-fns|victory-*)',
],
}