Skip to content

Add CLI integration tests for config precedence and exit codes #7

Description

@LyraZeta

Why

LayoutScope v0.3.0 supports project config discovery and explicit CLI overrides, but the current coverage does not exercise the full precedence and exit-code contract from the command-line process boundary.

Scope

Add focused, cross-platform integration tests that launch the CLI against a deterministic local fixture and cover:

  • explicit --path, --viewport, --wait, --ready, and --fail-on values overriding their config-file counterparts
  • --no-auto-config ignoring a discovered layoutscope.config.* file
  • an explicit --config still loading when auto-discovery is disabled
  • exit code 0 for a passing scan or --fail-on never, 1 when the selected threshold is reached, and 2 for invalid configuration or CLI input

Acceptance criteria

  • Tests use a local fixture and make no external network requests.
  • Assertions prefer JSON/report metadata over ANSI-formatted terminal text.
  • The test setup works on Windows and Linux without shell-specific command strings.
  • pnpm check passes.
  • Production behavior stays unchanged unless the integration test exposes a real bug, in which case keep the fix narrowly scoped and explain it in the PR.

This is deliberately test-focused; using the existing fixtures and helpers is encouraged.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions