Skip to content

Mock fs and repo paths before loading set-version in its test - #59352

Open
robhogan wants to merge 1 commit into
mainfrom
robhogan/set-version-test-mocks
Open

robhogan wants to merge 1 commit into
mainfrom
robhogan/set-version-test-mocks

Conversation

@robhogan

Copy link
Copy Markdown
Collaborator

Summary:

Missed from #59307: set-version-test registers its node:fs and shared/consts mocks after loading set-version, so they only applied because inline requires deferred loading its dependencies. This registers both mocks before set-version is required.

Prerequisite for #59303, without which setVersion writes to the real repo, its 38 snapshots go obsolete, and test_js fails under --ci.

Changelog:

[INTERNAL] [CHANGED] - Mock fs and repo paths before loading set-version in its test

Test Plan:

set-version-test passes with all 38 snapshots checked, on main and with #59303 on top, and leaves the checkout untouched.

`set-version-test` registered its `node:fs` mock in `beforeAll` and its `shared/consts` mock after requiring `set-version`, so the mocks only applied because inline requires deferred loading `set-version`'s dependencies until first use. Without that, `setVersion` writes to the real repo, nothing is snapshotted, and Jest reports 38 obsolete snapshots, which fails `--ci`.

Both mocks are now registered before `set-version` is required.

Changelog: [Internal]
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 22, 2026
@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Oct 22, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant