Skip to content

Commit 2c97768

Browse files
committed
Merge remote-tracking branch 'origin/master' into use-mutebable-source
2 parents c7c2f0c + a1cad54 commit 2c97768

12 files changed

+2617
-2462
lines changed

jest.config.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
1+
const { defaults: tsjPreset } = require('ts-jest/presets')
2+
13
const defaults = {
24
coverageDirectory: './coverage/',
35
collectCoverage: true,
46
testURL: 'http://localhost',
57
}
6-
const testFolderPath = (folderName) => `<rootDir>/test/${folderName}/**/*.js`
78

89
const 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-
1611
const tsTestFolderPath = (folderName) =>
1712
`<rootDir>/test/${folderName}/**/*.{ts,tsx}`
1813

@@ -26,13 +21,14 @@ const tsStandardConfig = {
2621
const 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

3632
module.exports = {
37-
projects: [tsStandardConfig, standardConfig, rnConfig],
33+
projects: [tsStandardConfig, rnConfig],
3834
}

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,12 @@
8080
"@testing-library/react": "^12.0.0",
8181
"@testing-library/react-hooks": "^3.4.2",
8282
"@testing-library/react-native": "^7.1.0",
83+
"@types/create-react-class": "^15.6.3",
8384
"@types/object-assign": "^4.0.30",
8485
"@types/react": "^17.0.14",
8586
"@types/react-dom": "^17.0.9",
8687
"@types/react-is": "^17.0.1",
88+
"@types/react-native": "^0.64.12",
8789
"@types/react-redux": "^7.1.18",
8890
"@typescript-eslint/eslint-plugin": "^4.28.0",
8991
"@typescript-eslint/parser": "^4.28.0",

0 commit comments

Comments
 (0)