You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test(fmt): color tests fail when NO_COLOR is set #7322
deno task ok fails when the caller has NO_COLOR set. The color implementation correctly disables ANSI codes, but several tests always expect colored output.
This affects fmt/colors_test.ts, internal/styles_test.ts, and cli/unstable_spinner_test.ts. I ran the focused color tests 10 times with NO_COLOR=1. Every run failed. All 10 passed with the variable unset.
Steps to Reproduce
NO_COLOR=1 deno test -A \
fmt/colors_test.ts \
internal/styles_test.ts \
cli/unstable_spinner_test.ts
As a control:
env -u NO_COLOR deno test -A \
fmt/colors_test.ts \
internal/styles_test.ts \
cli/unstable_spinner_test.ts
The control passes. A full env -u NO_COLOR deno task test run reported 7,462 passed and 0 failed.
Expected behavior
The test suite should control color state instead of inheriting it from the caller. Tests that assert ANSI output should run with colors enabled, while the existing no-color coverage should keep verifying NO_COLOR in an isolated process.
Actual behavior
Deno.noColor is true at process startup, so the implementation returns unstyled strings. Tests such as red() single color still expect ANSI escape codes and fail. setColorEnabled(true) cannot override this because it intentionally respects Deno.noColor.
This does not appear in GitHub Actions because the workflow does not set NO_COLOR. It is a local test-hermeticity problem, not a runtime bug.
Activity
miso-devel commentedon Sep 26, 2026
Hello, I'd like to work on this issue.