Skip to content

Fix 3 failing object-formatting tests in non-TTY environments#35

Merged
vbergae merged 1 commit into
mainfrom
fix/object-formatting-tests
May 16, 2026
Merged

Fix 3 failing object-formatting tests in non-TTY environments#35
vbergae merged 1 commit into
mainfrom
fix/object-formatting-tests

Conversation

@vbergae

@vbergae vbergae commented May 16, 2026

Copy link
Copy Markdown
Owner

Summary

  • The colored crate disables ANSI codes when stdout is not a TTY (e.g. in test runners), causing the three object-formatting tests to fail because their expected strings included ANSI color codes.
  • Added colored::control::set_override(true) before formatting and unset_override() after in each affected test to force color output regardless of environment.

Tests affected

  • nodes::object::object_tests::it_formats_an_object
  • nodes::object::object_tests::it_formats_a_multidimensional_object
  • formatter::json_formatter_tests::it_formats_an_object

Test plan

  • cargo test passes with 30/30 tests green

Generated by Claude Code

…TTY environments

The `colored` crate disables ANSI codes when stdout is not a TTY (as in test
runners). Tests that assert on colored key output now call
`colored::control::set_override(true)` before formatting and reset with
`unset_override()` after, so they reliably exercise the color code path.

https://claude.ai/code/session_01FHd1Nx228QwtR5sGowP7mN
@vbergae vbergae merged commit c0e5a56 into main May 16, 2026
9 checks passed
@vbergae vbergae deleted the fix/object-formatting-tests branch May 16, 2026 21:27
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.

2 participants