Skip to content

NodeJS Compat: more utils tests, experimentalWarning, styleText#4225

Merged
guybedford merged 9 commits intomainfrom
gbedford/more-utils
Jun 5, 2025
Merged

NodeJS Compat: more utils tests, experimentalWarning, styleText#4225
guybedford merged 9 commits intomainfrom
gbedford/more-utils

Conversation

@guybedford
Copy link
Contributor

Adds more utils tests including:

  • test/parallel/test-util-callbackify.js
  • test/parallel/test-util-inherits.js
  • test/parallel/test-util-promisify.js
  • test/parallel/test-util-stripvtcontrolcharacters.js

Then also includes a noop implementation of util.emitExperimentalWarning, and adds support for util.styleText, porting those test suites as well.

@guybedford guybedford requested review from a team as code owners May 31, 2025 00:25
@guybedford guybedford requested a review from a team May 31, 2025 00:25
Copy link
Contributor

@windsurf-bot windsurf-bot bot left a comment

Choose a reason for hiding this comment

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

Other comments (1)
  • src/node/util.ts (289-290) The non-null assertion operator (`!`) after optional chaining (`?.`) in `(stream as any)!.getColorDepth()` is redundant and potentially confusing. If the optional chaining returns undefined, the assertion won't be reached. Consider removing the non-null assertion.
1 file skipped due to size limits:
  • src/workerd/api/node/tests/util-nodejs-test.js

@guybedford guybedford force-pushed the gbedford/more-utils branch from af99601 to e9f246e Compare June 2, 2025 17:10
Copy link
Member

@anonrig anonrig left a comment

Choose a reason for hiding this comment

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

Other than the mustCall() implementation, LGTM, but I don't think we should start implementing nodejs test runner yet.

@guybedford guybedford force-pushed the gbedford/more-utils branch from e9f246e to 335835f Compare June 5, 2025 20:38
@guybedford guybedford merged commit 3d3299b into main Jun 5, 2025
18 checks passed
@guybedford guybedford deleted the gbedford/more-utils branch June 5, 2025 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants