1
+ const { defaults : tsjPreset } = require ( 'ts-jest/presets' )
2
+
1
3
const defaults = {
2
4
coverageDirectory : './coverage/' ,
3
5
collectCoverage : true ,
4
6
testURL : 'http://localhost' ,
5
7
}
6
- const testFolderPath = ( folderName ) => `<rootDir>/test/${ folderName } /**/*.js`
7
8
8
9
const NORMAL_TEST_FOLDERS = [ 'components' , 'hooks' , 'integration' , 'utils' ]
9
10
10
- const standardConfig = {
11
- ...defaults ,
12
- displayName : 'ReactDOM' ,
13
- testMatch : NORMAL_TEST_FOLDERS . map ( testFolderPath ) ,
14
- }
15
-
16
11
const tsTestFolderPath = ( folderName ) =>
17
12
`<rootDir>/test/${ folderName } /**/*.{ts,tsx}`
18
13
@@ -26,13 +21,14 @@ const tsStandardConfig = {
26
21
const rnConfig = {
27
22
...defaults ,
28
23
displayName : 'React Native' ,
29
- testMatch : [ testFolderPath ( 'react-native' ) ] ,
24
+ testMatch : [ tsTestFolderPath ( 'react-native' ) ] ,
30
25
preset : 'react-native' ,
31
26
transform : {
32
27
'^.+\\.js$' : '<rootDir>/node_modules/react-native/jest/preprocessor.js' ,
28
+ ...tsjPreset . transform ,
33
29
} ,
34
30
}
35
31
36
32
module . exports = {
37
- projects : [ tsStandardConfig , standardConfig , rnConfig ] ,
33
+ projects : [ tsStandardConfig , rnConfig ] ,
38
34
}
0 commit comments