Skip to content

Use fs.rmSync to clean up after the codegen executor test - #60363

Draft
ide wants to merge 1 commit into
react:mainfrom
expo:@ide/codegen-test-rmsync
Draft

ide wants to merge 1 commit into
react:mainfrom
expo:@ide/codegen-test-rmsync

Conversation

@ide

@ide ide commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

Summary:

Node 26 no longer accepts the recursive option of fs.rmdirSync; the call throws ERR_INVALID_ARG_VALUE. The afterAll of generate-artifacts-executor-test.js makes that call, so on Node 26 Jest reports the suite as failed although all of its tests pass:

TypeError: The property 'options.recursive' is no longer supported. Received true
  > 46 |       fs.rmdirSync(outputDir, {recursive: true});

This change removes the directory with fs.rmSync(outputDir, {recursive: true, force: true}), the replacement that Node's deprecation notice gives (DEP0147) and the call the rest of the file already uses. packages/react-native/package.json declares support for Node >= 26.0.0.

Changelog:

[INTERNAL] [FIXED] - Fix the codegen executor test on Node 26

Test Plan:

Run on Node 26.12.0 against 94aee19ac9:

yarn jest --runInBand packages/react-native/scripts/codegen/__tests__/generate-artifacts-executor-test.js
  • main: 52 tests and 24 snapshots pass, and the suite fails in afterAll with the error above.
  • This branch: the suite passes, with 52 tests and 24 snapshots.

yarn eslint --max-warnings 0 and prettier --check pass on the changed file. I did not run Flow or another Node version for this one-line change.

🤖 Generated with Claude Code

Node 26 no longer accepts the `recursive` option of `fs.rmdirSync`: the
call throws ERR_INVALID_ARG_VALUE. The `afterAll` in
generate-artifacts-executor-test.js makes that call, so on Node 26 Jest
reports the suite as failed although all 52 of its tests pass.

Remove the output directory with `fs.rmSync(path, {recursive: true,
force: true})`, the replacement that Node's deprecation notice
(DEP0147) gives and the call the rest of the file already uses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@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 Nov 28, 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant