Skip to content

Add test for invalid --max-diff-size flag #212

Description

@404-Page-Found

Task summary

The suggest command validates --max-diff-size and exits with "Invalid --max-diff-size value. Expected a positive integer." when given invalid input, but there is no test covering non-numeric, zero, or negative values.

Why this is a good first issue

The error message and validation logic already exist. The task is writing one CLI test that asserts exit code and stderr output — a good intro to the project's node:test patterns.

Suggested files or areas

  • src/commands/suggest.ts — validation logic (line ~146)
  • tests/empty-repo-suggest.test.mjs — pattern to follow
  • tests/e2e/suggest-smoke.test.mjs — has a valid --max-diff-size case for reference

Acceptance criteria

  • Test covers at least one invalid value (e.g. 0, -1, or abc)
  • Test asserts non-zero exit code
  • Test asserts the error message is printed
  • npm test passes

Extra context

tests/config-store.test.mjs already tests invalid maxDiffSize values at the config layer; this issue covers the CLI flag path specifically.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions