-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathjest.config.js
56 lines (54 loc) · 1.31 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
47
48
49
50
51
52
53
54
55
56
const esModules = [
'@react-native-community',
'@react-native-picker',
'@react-native',
'react-native',
'uuid',
].join('|')
const globalConfig = {
globals: {
__DEV__: true,
},
transformIgnorePatterns: [`node_modules/(?!(${esModules}))`],
moduleNameMapper: {
'\\.(jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/lib/__mocks__/fileMock.ts',
'\\.svg$': '<rootDir>/lib/__mocks__/svgMock.ts',
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
}
module.exports = {
projects: [
{
preset: 'react-native',
displayName: 'default',
setupFiles: ['<rootDir>/jest.setup.js'],
fakeTimers: {
enableGlobally: true,
},
haste: {
defaultPlatform: 'android',
platforms: ['android', 'ios', 'native'],
},
...globalConfig,
},
{
displayName: 'model',
testEnvironment: 'node',
testMatch: [
'**/__model__tests__/**/*.[jt]s?(x)',
'**/?(*.)+(model-spec|model-test).[jt]s?(x)',
],
...globalConfig,
},
{
displayName: 'rules',
testEnvironment: 'node',
testMatch: [
'**/__rules__tests__/**/*.[jt]s?(x)',
'**/?(*.)+(rules-spec|rules-test).[jt]s?(x)',
],
...globalConfig,
},
],
}