-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathjest.config.js
More file actions
35 lines (30 loc) · 1.02 KB
/
jest.config.js
File metadata and controls
35 lines (30 loc) · 1.02 KB
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
const testFolderPath = folderName => `<rootDir>/test/${folderName}/**/*.spec.js`;
const NORMAL_TEST_FOLDERS = ['components', 'integration'];
const standardConfig = {
testEnvironment: 'jest-environment-jsdom',
testEnvironmentOptions: {
url: 'http://localhost'
},
displayName: 'ReactDOM',
testMatch: NORMAL_TEST_FOLDERS.map(testFolderPath),
};
// eslint-disable-next-line no-unused-vars
const rnConfig = {
displayName: 'React Native',
testMatch: [testFolderPath('react-native')],
preset: 'react-native',
// this is not working anymore. Need to fix
transform: {
'^.+\\.js$': '<rootDir>/node_modules/react-native/jest/preprocessor.js'
}
};
module.exports = {
//projects: [standardConfig, rnConfig],
projects: [standardConfig],
// the last project overriders the coverage, so coverage from CI is not useful. use this two for local testing:
//projects: [standardConfig],
//projects: [rnConfig],
coverageDirectory: './coverage/',
collectCoverage: true,
coverageReporters: ['json', 'text', 'html'],
};