Skip to content

Commit

Permalink
Switch to Hermes parser in Jest preset
Browse files Browse the repository at this point in the history
Summary:
Resolves facebook#46355.

Changelog: [Internal]

Differential Revision: D62583337
  • Loading branch information
Alex Hunt authored and facebook-github-bot committed Sep 13, 2024
1 parent b98b9f1 commit d2e0f91
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 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
19 changes: 17 additions & 2 deletions 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 Expand Up @@ -7387,11 +7387,26 @@ react-devtools-core@^5.3.1:
shell-quote "^1.6.1"
ws "^7"

react-is@19.0.0-rc-fb9a90fa48-20240614, react-is@^16.13.1, react-is@^16.8.4, react-is@^17.0.1, react-is@^18.0.0:
react-is@19.0.0-rc-fb9a90fa48-20240614:
version "19.0.0-rc-fb9a90fa48-20240614"
resolved "https://registry.yarnpkg.com/react-is/-/react-is-19.0.0-rc-fb9a90fa48-20240614.tgz#6987893799abdedf2e9929e31541cb6d7dc8285a"
integrity sha512-60qI7v1B9RhmZwjTCnAgzcuABOQsIH20vTbETQPaze96s1lY2lSawv9dvXAfF8Z1MIqOppWSKLNOshF0WsZ3OA==

react-is@^16.13.1, react-is@^16.8.4:
version "16.13.1"
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"
integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==

react-is@^17.0.1:
version "17.0.2"
resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0"
integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==

react-is@^18.0.0:
version "18.3.1"
resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.3.1.tgz#e83557dc12eae63a99e003a46388b1dcbb44db7e"
integrity sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==

react-refresh@^0.14.0:
version "0.14.2"
resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.14.2.tgz#3833da01ce32da470f1f936b9d477da5c7028bf9"
Expand Down

0 comments on commit d2e0f91

Please sign in to comment.