Skip to content

Commit

Permalink
Switch to Hermes parser in Jest preset (facebook#46465)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: facebook#46465

Resolves facebook#46355.

Changelog: [Internal]

bypass-github-export-checks

Differential Revision: D62583337

Reviewed By: robhogan
  • Loading branch information
Alex Hunt authored and facebook-github-bot committed Sep 16, 2024
1 parent 68a92aa commit 22c1d0b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion packages/react-native/jest-preset.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ module.exports = {
platforms: ['android', 'ios', 'native'],
},
transform: {
'^.+\\.(js|ts|tsx)$': 'babel-jest',
'^.+\\.(js)$': [
'babel-jest',
{plugins: ['babel-plugin-syntax-hermes-parser']},
],
'^.+\\.(ts|tsx)$': 'babel-jest',
'^.+\\.(bmp|gif|jpg|jpeg|mp4|png|psd|svg|webp)$': require.resolve(
'./jest/assetFileTransformer.js',
),
Expand Down
1 change: 1 addition & 0 deletions packages/react-native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
"abort-controller": "^3.0.0",
"anser": "^1.4.9",
"ansi-regex": "^5.0.0",
"babel-plugin-syntax-hermes-parser": "^0.23.1",
"base64-js": "^1.5.1",
"chalk": "^4.0.0",
"commander": "^12.0.0",
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2810,7 +2810,7 @@ babel-plugin-syntax-hermes-parser@0.23.0:
dependencies:
hermes-parser "0.23.0"

babel-plugin-syntax-hermes-parser@0.23.1:
babel-plugin-syntax-hermes-parser@0.23.1, babel-plugin-syntax-hermes-parser@^0.23.1:
version "0.23.1"
resolved "https://registry.yarnpkg.com/babel-plugin-syntax-hermes-parser/-/babel-plugin-syntax-hermes-parser-0.23.1.tgz#470e9d1d30ad670d4c8a37138e22ae39c843d1ff"
integrity sha512-uNLD0tk2tLUjGFdmCk+u/3FEw2o+BAwW4g+z2QVlxJrzZYOOPADroEcNtTPt5lNiScctaUmnsTkVEnOwZUOLhA==
Expand Down

0 comments on commit 22c1d0b

Please sign in to comment.