react-native/scripts
Douglas Lowder e42932cfc6 fix: Remove setting of process.exitCode that breaks Jest tests (#45562)
Summary:
In Node 20, the script to run unit tests in CI (`scripts/run-ci-javascript-tests.js`) will fail, even when all the Jest tests pass. This happens because one of the JS modules being tested is setting `process.exitCode` (see https://github.com/jestjs/jest/issues/9324#issuecomment-1808090455).

Changes:

- Modified the affected module to throw an exception when failing, instead of setting the exit code
- Adjusted the unit test for that module

## Changelog:

[General] [Fixed] - Remove setting of process.exitCode that breaks Jest tests

Pull Request resolved: https://github.com/facebook/react-native/pull/45562

Test Plan:
Before this change, running `node scripts/run-ci-javascript-tests.js` would fail with Node 20.
After this change, it succeeds.

Reviewed By: blakef

Differential Revision: D60033582

Pulled By: cipolleschi

fbshipit-source-id: 71b7f4495d414e719a9bd2d892bd1bc3045ddd5d
2024-07-22 03:37:08 -07:00
..
__tests__ Move all package.json updates into set-version script (#45180) 2024-06-26 07:59:49 -07:00
build Use metro-babel-register for additive Babel registration (#45295) 2024-07-05 04:48:30 -07:00
circleci Remove report-app-size (#45483) 2024-07-18 04:34:32 -07:00
debugger-frontend Add --create-diff mode to debugger-frontend sync script (#43621) 2024-03-22 12:11:48 -07:00
e2e Move helloworld to build from artifacts on Android (#45517) 2024-07-19 08:55:19 -07:00
monorepo Remove bump-all-updated-packages script (#43534) 2024-03-19 07:05:03 -07:00
release-testing Move helloworld to build from artifacts on Android (#45517) 2024-07-19 08:55:19 -07:00
releases fix linting noise (#45465) 2024-07-17 10:07:00 -07:00
releases-ci fix: Remove setting of process.exitCode that breaks Jest tests (#45562) 2024-07-22 03:37:08 -07:00
utils Port changes in the release testing script from the release branch (#45174) 2024-06-27 04:11:44 -07:00
.tests.env Test against XCode 14.3 and 15 (#41798) 2023-12-05 15:35:05 -08:00
clean-gha-cache.js Only cache node_modules on main (#45544) 2024-07-19 13:04:07 -07:00
consts.js Fix RNTester Podfile.lock update in release workflow (#43513) 2024-03-15 10:32:07 -07:00
lint-java.js Enable lint/sort-imports everywhere (#41334) 2023-11-06 12:59:38 -08:00
npm-utils.js Move all package.json updates into set-version script (#45180) 2024-06-26 07:59:49 -07:00
objc-test.sh Port CI improvements from Release branch to main (#45175) 2024-06-27 04:11:44 -07:00
process-podspecs.sh Update copyright headers from Facebook to Meta 2021-12-30 15:11:21 -08:00
run-ci-javascript-tests.js RN: Fix Open Source Test Scripts 2024-03-29 01:42:24 -07:00
scm-utils.js Enable Flow on misc release scripts (#42736) 2024-01-31 03:36:02 -08:00
sync-css-layout.sh | RN Monorepo | Migrate to package (#36434) 2023-03-17 05:03:25 -07:00
validate-ios-test-env.sh bump Node references from 12/14 to 14/16 (#32980) 2022-01-28 05:07:18 -08:00