Summary
Snapshot tests for advisory reporting helpers are well-designed, but end-to-end snapshot tests for validate-audit.js error output are missing despite the PR recommendation.
Problems
- No snapshot tests exist for the following error paths in
validate-audit.js:
- AJV schema validation errors (malformed
audit-exceptions.json).
- Unexpected advisory detection (
reportUnexpectedAdvisories output).
- Validator vulnerability detection errors (advisory present in audit but not in exception ledger).
Acceptance criteria
- Add snapshot tests (using Vitest
toMatchInlineSnapshot or toMatchSnapshot) for validate-audit.js error paths, covering at minimum:
- Schema validation failure output.
- Unexpected-advisory heading and bullet-line output.
- At least one end-to-end path that drives
validate-audit.js from a controlled advisory fixture through to the final error message captured from reportingIo.
Context
Raised during review of PR #354 by @leynos.
Summary
Snapshot tests for advisory reporting helpers are well-designed, but end-to-end snapshot tests for
validate-audit.jserror output are missing despite the PR recommendation.Problems
validate-audit.js:audit-exceptions.json).reportUnexpectedAdvisoriesoutput).Acceptance criteria
toMatchInlineSnapshotortoMatchSnapshot) forvalidate-audit.jserror paths, covering at minimum:validate-audit.jsfrom a controlled advisory fixture through to the final error message captured fromreportingIo.Context
Raised during review of PR #354 by @leynos.