forked from pass-culture/pass-culture-app-native
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.web.config.js
41 lines (39 loc) · 1.45 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
40
41
// eslint-disable-next-line @typescript-eslint/no-var-requires
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,
'<rootDir>/jest/jest.web.setup.ts',
],
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-modal$': 'modal-enhanced-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>/__mocks__/fileMock.ts',
'\\.(css|less)$': '<rootDir>/__mocks__/fileMock.ts',
// temporary mock things until implemented
'react-native-fast-image': '<rootDir>/__mocks__/fragmentMock.ts',
},
collectCoverageFrom: [...base.collectCoverageFrom, '!**/*.(native|ios|android).*'],
testPathIgnorePatterns: [
...base.testPathIgnorePatterns,
'.*(/tests?/.*.(native|ios|android).(test|spec)).(tsx?)$',
],
transform: {
...base.transform,
},
verbose: true,
globals: {
__DEV__: true,
},
}