Skip to content

Improve test suite: remove redundancy, add table-driven tests, fill coverage gaps - #46

Merged
xehl merged 1 commit into
mainfrom
improve-testing
Mar 11, 2026
Merged

Improve test suite: remove redundancy, add table-driven tests, fill coverage gaps#46
xehl merged 1 commit into
mainfrom
improve-testing

Conversation

@xehl

@xehl xehl commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Remove redundant tests superseded by table-driven equivalents (13 individual staticdisplay type tests, JaroWinklerKnownValues, SubcommandsHaveActions, ShowJSON_WritesToFile, duplicate iterator transform test)
  • Convert to table-driven tests across 5 test groups: formatResult types, flagOptions variants, missing-required-flag errors, iterator format outputs, and hidden subcommands
  • Tighten weak assertions: countTerminalLines now uses exact expected values instead of GreaterOrEqual; vacuous NotContains in ShowJSON_Transform replaced with exact Equal
  • Fill coverage gaps: createDownloadFile (Content-Disposition, MIME fallback, directory traversal sanitization), no-close-match suggest, tenant CRUD integration test
  • Un-skip 26 auto-generated mock server tests by updating the mocktest helper to gracefully skip when the mock server is unreachable instead of hard-failing
  • Add new test files: stdin piping, error paths (missing flags, invalid format, API errors via httptest, connection refused, unknown subcommands), command structure, format functions, iterator output, explorer/static display rendering, and real-API integration tests gated on COURIER_API_KEY

…overage gaps

- Remove redundant tests superseded by table-driven equivalents (staticdisplay
  individual type tests, JaroWinklerKnownValues, SubcommandsHaveActions,
  ShowJSON_WritesToFile)
- Convert 5 test groups to table-driven: formatResult types, flagOptions,
  missing-required-flag errors, iterator formats, hidden subcommands
- Tighten weak assertions (countTerminalLines exact values, ShowJSON_Transform
  vacuous NotContains replaced with exact Equal)
- Fix WithTransform iterator test to actually exercise the transform code path
- Add new tests: no-close-match suggest, createDownloadFile (Content-Disposition,
  MIME fallback, directory traversal), tenant CRUD integration test
- Un-skip 26 auto-generated mock server tests (graceful skip via mocktest helper)
- Add unit tests for stdin piping, error paths, command structure, format
  functions, iterator output, and explorer/static display rendering
@xehl
xehl merged commit d675e76 into main Mar 11, 2026
7 checks passed
@xehl
xehl deleted the improve-testing branch March 11, 2026 16:54
xehl added a commit that referenced this pull request Mar 12, 2026
These test files from PR #46 reference old function signatures that
changed in the Stainless regeneration. They'll be re-added once
updated to match the new generated code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant