Skip to content

fix(usage): reject invalid output modes#49

Open
JerryNee wants to merge 1 commit into
TestSprite:mainfrom
JerryNee:fix/usage-output-validation
Open

fix(usage): reject invalid output modes#49
JerryNee wants to merge 1 commit into
TestSprite:mainfrom
JerryNee:fix/usage-output-validation

Conversation

@JerryNee

Copy link
Copy Markdown

Summary

  • validate testsprite usage --output <mode> against the supported json|text modes
  • return the existing local VALIDATION_ERROR shape instead of silently treating unsupported modes as text
  • add command-wiring coverage for the regression

Before

testsprite usage --output yaml --dry-run exited 0 and printed text output.

After

testsprite usage --output yaml --dry-run exits 5 with:

Error: Invalid request.
Flag `--output` is invalid: must be one of: json, text.

Verification

  • npm test -- src/commands/usage.test.ts
  • npm run lint
  • npm run typecheck
  • npm test
  • npm run build
  • node dist/index.js usage --output yaml --dry-run

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.

1 participant