Improve --reporter flag help and error messages (#22900)

## Summary
- Clarifies help text for `--reporter` and `--reporter-outfile` flags
- Improves error messages when invalid reporter formats are specified
- Makes distinction between test reporters and coverage reporters
clearer

## Changes
1. Updated help text in `Arguments.zig` to better explain:
   - What formats are currently available (only 'junit' for --reporter)
   - Default behavior (console output for tests)
   - Requirements (--reporter-outfile needed with --reporter=junit)
   
2. Improved error messages to list available options when invalid
formats are used

3. Updated CLI completions to match the new help text

## Test plan
- [x] Built and tested with `bun bd`
- [x] Verified help text displays correctly: `./build/debug/bun-debug
test --help`
- [x] Tested error message for invalid reporter:
`./build/debug/bun-debug test --reporter=json`
- [x] Tested error message for missing outfile: `./build/debug/bun-debug
test --reporter=junit`
- [x] Tested error message for invalid coverage reporter:
`./build/debug/bun-debug test --coverage-reporter=invalid`
- [x] Verified junit reporter still works: `./build/debug/bun-debug test
--reporter=junit --reporter-outfile=/tmp/junit.xml`
- [x] Verified lcov coverage reporter still works:
`./build/debug/bun-debug test --coverage --coverage-reporter=lcov`

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

Co-authored-by: Claude Bot <claude-bot@bun.sh>
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
robobun
2025-09-24 18:26:37 -07:00
committed by GitHub
parent 57b93f6ea3
commit f9a042f114
2 changed files with 7 additions and 7 deletions

View File

@@ -122,7 +122,7 @@
},
{
"name": "reporter",
"description": "Specify the test reporter. Currently --reporter=junit is the only supported format.",
"description": "Test output reporter format. Available: 'junit' (requires --reporter-outfile). Default: console output.",
"hasValue": true,
"valueType": "val",
"required": false,
@@ -130,7 +130,7 @@
},
{
"name": "reporter-outfile",
"description": "The output file used for the format from --reporter.",
"description": "Output file path for the reporter format (required with --reporter).",
"hasValue": true,
"valueType": "val",
"required": false,