-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.web.config.js
39 lines (38 loc) · 1.25 KB
/
jest.web.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
const base = require('./jest.config');
module.exports = {
...base,
preset: 'react-native-web',
testEnvironment: 'jest-environment-jsdom',
snapshotResolver: '<rootDir>/jest/custom-snapshot-resolver-web.js',
setupFiles: ['react-native-web/jest/setup.js', ...base.setupFiles],
setupFilesAfterEnv: ['<rootDir>/jest/jest.web.setupAfterEnv.js'],
testRegex: '(?<!.(?:native|ios|android)).(?:test|spec).(?:tsx?|js)$',
moduleFileExtensions: [
'web.tsx',
'web.ts',
'web.js',
'web.jsx',
...base.moduleFileExtensions,
],
moduleNameMapper: {
...base.moduleNameMapper,
'^react-native$': 'react-native-web',
'^react-native-svg$': 'react-native-svg-web',
'^react-native-linear-gradient$': 'react-native-web-linear-gradient',
'\\.(jpg|ico|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>jest/__mocks__/fileMock.js',
'\\.(css|less)$': '<rootDir>/jest/__mocks__/fileMock.js',
'react-native-fast-image': '<rootDir>/__mocks__/fragmentMock.ts',
},
testPathIgnorePatterns: [
...base.testPathIgnorePatterns,
'.*(/tests?/.*.(native|ios|android).(test|spec)).(tsx?)$',
],
transform: {
...base.transform,
},
verbose: true,
globals: {
__DEV__: true,
},
};