-
Notifications
You must be signed in to change notification settings - Fork 1
/
jest.config.js
58 lines (58 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
module.exports = {
collectCoverageFrom: [
'src/**/*.{js,jsx,ts,tsx}',
'!src/**/*.(d.ts|stories.js)',
'!src/**/*Styled.js',
'!src/**/index.js',
'!src/serviceWorker.js',
'!src/containers/labeling.js',
'!src/test/testComponentHelper.js',
'!src/i18NextInit.js'
],
coverageDirectory: '<rootDir>/coverage',
resolver: 'jest-pnp-resolver',
setupFiles: ['react-app-polyfill/jsdom', '<rootDir>/src/setupTests.js'],
testMatch: [
'<rootDir>/src/**/__tests__/**/*.{js,jsx,ts,tsx}',
'<rootDir>/src/**/?(*.)(spec|test).{js,jsx,ts,tsx}'
],
testEnvironment: 'jsdom',
testURL: 'http://localhost',
transform: {
'^.+\\.(js|jsx|ts|tsx)$': '<rootDir>/node_modules/babel-jest',
'^.+\\.css$': '<rootDir>/config/jest/cssTransform.js',
'^.+\\.svg$': '<rootDir>/config/jest/svgTransform.js',
'^(?!.*\\.(js|jsx|ts|tsx|css|json|svg)$)':
'<rootDir>/config/jest/fileTransform.js'
},
transformIgnorePatterns: [
'[/\\\\]node_modules[/\\\\].+\\.(js|jsx|ts|tsx)$',
'^.+\\.module\\.(css|sass|scss)$'
],
moduleNameMapper: {
'^react-native$': 'react-native-web',
'^.+\\.module\\.(css|sass|scss)$': 'identity-obj-proxy',
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/__mocks__/fileMock.js'
},
moduleDirectories: ['node_modules', 'src'],
moduleFileExtensions: [
'web.js',
'js',
'web.ts',
'ts',
'web.tsx',
'tsx',
'json',
'web.jsx',
'jsx',
'node'
],
watchPlugins: [
'<rootDir>/node_modules/jest-watch-typeahead/filename.js',
'<rootDir>/node_modules/jest-watch-typeahead/testname.js'
],
globals: {
ENVIRONMENT_CONFIGURATION: {}
}
};