Repository navigation
fix(ext/node): expose internal/tty as requireable module - #34105
Merged
Merged
Conversation
Some Node.js compatibility tests (e.g. test-output-assertion-color-tty,
test-output-coverage-width-80-color) `require('internal/tty')` to detect
TTY color support before deciding whether to run. This previously failed
with "Cannot find module 'internal/tty'".
Wire `internal/tty` into the CJS require map so it resolves to the
existing ESM polyfill at `ext:deno_node/internal/tty.js`, and expose
`isatty`, `hasColors`, and `getColorDepth` from that module (matching
the surface the tests use). `WriteStream.prototype.hasColors` now
delegates to the standalone `hasColors` function.
Closes denoland/orchid#97
fibibot
approved these changes
May 16, 2026
fibibot
left a comment
Contributor
There was a problem hiding this comment.
No issues found. internal/tty now resolves through the native module map, and the exported getColorDepth / hasColors functions match the shape Node uses before node:tty attaches them to WriteStream.prototype; hasColors() still delegates through the same color-depth logic as before.
CI is green.
Contributor
|
@bartlomieju this is ready to merge |
Member
|
No tests enabled @divybot? |
Enable the three test-runner snapshot tests that previously failed with
"Cannot find module 'internal/tty'":
- test-output-assertion-color-tty.mjs
- test-output-coverage-width-80-color.mjs
- test-output-coverage-width-80-uncovered-lines-color.mjs
All three pass locally now that `require('internal/tty')` resolves.
Contributor
Author
|
Added the three test-runner snapshot tests that this fix unblocks ( |
littledivy
approved these changes
May 16, 2026
Member
|
@divybot resolve conflicts |
# Conflicts: # tests/node_compat/config.jsonc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes denoland/orchid#97