Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove process.exit calls from publish-npm and throw errors instead (f…
…acebook#43039) Summary: Changelog: [Internal] - `publish-npm.js` is a [script we call in our CI](https://www.internalfb.com/code/fbsource/[c0b8566ac0d66c2c0282eeb597bfb54bedf757c6]/xplat/js/react-native-github/.circleci/configurations/jobs.yml?lines=1243) to publish the react-native package and others. Currently, the script leverages `exit/process.exit` to terminate early in a couple of places which makes the code hard to test because our tests don't truly early exit when `exit/process.exit` is called. This change removes any explicit `exit` calls and instead leverages the uncaught error to terminate the process and set the non-zero exit code. This makes our tests more accurate to the real control flow of the script. I've also updated the tests to better capture what we're actually testing by mocking at a higher level. Reviewed By: cipolleschi Differential Revision: D53792754
- Loading branch information