Fix publish-npm test mocks isolation (#54479)

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

Fixes failing CI jobs on `0.83-stable`, e.g. https://github.com/facebook/react-native/actions/runs/19234912061/job/54982161510.

**Changes**

- Simplify main package `package.json` file read with existing `getWorkspaceRoot` util.
- Fix test by mocking `getWorkspaceRoot` (previously: read the real filesystem and caused test breakage outside `main`).
- Add additional `RC0 → RC1` test case.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D86674348

fbshipit-source-id: 0b8feb4cbf7b1ac7cf4cc560f066a0a10aec1b5f
This commit is contained in:
Alex Hunt authored and meta-codesync[bot] committed 2025-11-10 09:46:38 -08:00
1 parent ec7f729cb2
commit ee7575fec2
3 files changed
+83 -44

No files matched your search

+4
View File
@@ -45,6 +45,9 @@ export type PackageInfo = {
// The absolute path to the package
path: string,
// The package version
version: string,
// The parsed package.json contents
packageJson: PackageJson,
};
@@ -113,6 +116,7 @@ async function parsePackageInfo(
{
name: packageJson.name,
path: packagePath,
version: packageJson.version,
packageJson,
},
];