Skip to content

Add E2E snapshot tests for validate-audit.js error output paths #362

@coderabbitai

Description

@coderabbitai

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions