1+ const { defaults : tsjPreset } = require ( 'ts-jest/presets' )
2+
13const defaults = {
24 coverageDirectory : './coverage/' ,
35 collectCoverage : true ,
46 testURL : 'http://localhost' ,
57}
6- const testFolderPath = ( folderName ) => `<rootDir>/test/${ folderName } /**/*.js`
78
89const NORMAL_TEST_FOLDERS = [ 'components' , 'hooks' , 'integration' , 'utils' ]
910
10- const standardConfig = {
11- ...defaults ,
12- displayName : 'ReactDOM' ,
13- testMatch : NORMAL_TEST_FOLDERS . map ( testFolderPath ) ,
14- }
15-
1611const tsTestFolderPath = ( folderName ) =>
1712 `<rootDir>/test/${ folderName } /**/*.{ts,tsx}`
1813
@@ -26,13 +21,14 @@ const tsStandardConfig = {
2621const rnConfig = {
2722 ...defaults ,
2823 displayName : 'React Native' ,
29- testMatch : [ testFolderPath ( 'react-native' ) ] ,
24+ testMatch : [ tsTestFolderPath ( 'react-native' ) ] ,
3025 preset : 'react-native' ,
3126 transform : {
3227 '^.+\\.js$' : '<rootDir>/node_modules/react-native/jest/preprocessor.js' ,
28+ ...tsjPreset . transform ,
3329 } ,
3430}
3531
3632module . exports = {
37- projects : [ tsStandardConfig , standardConfig , rnConfig ] ,
33+ projects : [ tsStandardConfig , rnConfig ] ,
3834}
0 commit comments