Skip to content

Fix failing test by suppressing Commander.js output - #10

Closed
github-actions[bot] wants to merge 1 commit into
mainfrom
agent/claude-code/issue-9
Closed

Fix failing test by suppressing Commander.js output#10
github-actions[bot] wants to merge 1 commit into
mainfrom
agent/claude-code/issue-9

Conversation

@github-actions

@github-actions github-actions Bot commented Nov 3, 2025

Copy link
Copy Markdown
Contributor

Summary

Fixes #9

This PR resolves the failing test by adding functionality to suppress Commander.js error output during test execution.

Changes

  • Added suppressCommanderOutput option to CliDependencies interface
  • Implemented suppressCommanderOutput() function to configure Commander.js output streams
  • Updated test setup to enable output suppression, preventing unwanted console output during tests

Test Plan

  • Existing tests now pass without Commander.js error output interfering with test results
  • The suppression only affects test execution and doesn't impact normal CLI behavior

Added suppressCommanderOutput option to CliDependencies to prevent
Commander.js from writing error messages to stderr during test runs.
This eliminates the "error: unknown option '--install'" message that
was appearing in test output when testing invalid option handling.

The fix configures Commander's output writers to no-op functions when
the suppressCommanderOutput flag is enabled, preventing error messages
from appearing in test output while still allowing proper error
handling via exceptions.

Fixes #9

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix the failing test

1 participant