Skip to content

Commit feb35ab

Browse files
robhoganfacebook-github-bot
authored andcommitted
Update to Jest 29 (#34724)
Summary: Pull Request resolved: #34724 Following on from the recent upgrade from Jest 26->27, this brings us up to present day Jest 29 for tests of React Native itself, Metro, and Meta-internal code. An update to the template for RN apps will follow. Changelog: [Internal][Fixed] Update to Jest 29 Reviewed By: huntie Differential Revision: D39543504 fbshipit-source-id: e00e7c2173a0e9af632874e4034ab781f289521d
1 parent 773615b commit feb35ab

4 files changed

Lines changed: 626 additions & 828 deletions

File tree

jest.config.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,14 @@ module.exports = {
1616
'.*': './jest/private/preprocessor.js',
1717
},
1818
setupFiles: ['./jest/setup.js'],
19-
timers: 'legacy',
19+
fakeTimers: {
20+
enableGlobally: true,
21+
legacyFakeTimers: true,
22+
},
23+
snapshotFormat: {
24+
escapeString: true,
25+
printBasicPrototype: true,
26+
},
2027
testRegex: '/__tests__/.*-test\\.js$',
2128
testPathIgnorePatterns: [
2229
'/node_modules/',

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
"react": "18.2.0"
106106
},
107107
"dependencies": {
108-
"@jest/create-cache-key-function": "^27.5.1",
108+
"@jest/create-cache-key-function": "^29.0.3",
109109
"@react-native-community/cli": "^9.0.0",
110110
"@react-native-community/cli-platform-android": "^9.0.0",
111111
"@react-native-community/cli-platform-ios": "^9.0.0",

repo-config/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"eslint-plugin-relay": "^1.8.3",
3838
"flow-bin": "^0.187.1",
3939
"inquirer": "^7.1.0",
40-
"jest": "^27.5.1",
40+
"jest": "^29.0.3",
4141
"jest-junit": "^10.0.0",
4242
"jscodeshift": "^0.13.1",
4343
"metro-babel-register": "0.72.1",

0 commit comments

Comments
 (0)