Background
Raised by @leynos from #14.
Problem
Text-based UI output tests lack proper snapshot testing infrastructure:
- Error messages in
tests/unit/test_fafo_error_messages.py use hardcoded literal string assertions. Any change to user-facing output silently passes unless the literal is manually updated.
- Integration tests use loose substring matching rather than exact message equality, allowing regressions in message wording, punctuation, or whitespace to go undetected.
Neither approach guarantees that changes to user-facing output receive explicit review.
Proposed solution
- Adopt a snapshot testing library (e.g. syrupy or pytest-snapshot) for error message assertions in
test_fafo_error_messages.py, so that any change to user-facing output produces a snapshot diff requiring explicit approval.
- Tighten integration test assertions to exact message equality with whitespace sensitivity, removing loose substring checks.
Benefits
- Changes to user-facing error messages surface in code review as snapshot diffs rather than silent test passes.
- Whitespace, punctuation, and formatting regressions are caught automatically.
- Snapshot files serve as living documentation of the expected CLI output.
Background
Raised by @leynos from #14.
Problem
Text-based UI output tests lack proper snapshot testing infrastructure:
tests/unit/test_fafo_error_messages.pyuse hardcoded literal string assertions. Any change to user-facing output silently passes unless the literal is manually updated.Neither approach guarantees that changes to user-facing output receive explicit review.
Proposed solution
test_fafo_error_messages.py, so that any change to user-facing output produces a snapshot diff requiring explicit approval.Benefits