Skip to content

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

Merged
javache merged 1 commit into
react:mainfrom
expo:@ide/codegen-test-rmsync
Nov 30, 2026
Merged

javache merged 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 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 Node's deprecation notice gives (DEP0147) and the call the rest of the file already uses. packages/react-native/package.json lists Node 26 as supported.

Changelog:

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

Test Plan:

On Node 26.12.0:

yarn jest --runInBand packages/react-native/scripts/codegen/__tests__/generate-artifacts-executor-test.js

On main, the tests and snapshots pass and the suite fails in afterAll with the error above; on this branch the suite passes. ESLint and Prettier pass. I did not run Flow or another Node version.

@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
@github-actions

github-actions Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Visual regression

No visual differences at 8709a78b560b.

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>
@ide
ide force-pushed the @ide/codegen-test-rmsync branch from 1a40a94 to 8709a78 Compare November 29, 2026 10:22
@ide
ide marked this pull request as ready for review November 29, 2026 12:02
@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 Nov 29, 2026

@chrfalch chrfalch left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, can be approved

@javache
javache merged commit f485bce into react:main Nov 30, 2026
100 checks passed
@ide
ide deleted the @ide/codegen-test-rmsync branch December 1, 2026 05:30
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.

3 participants