Commit d7c812d
test: add 100% coverage for logs-audit command (#1411)
Add comprehensive tests for src/commands/logs-audit.ts, covering:
- auditCommand with all three output formats (json, markdown, pretty)
- Error cases: no log entries found, no policy manifest found
- Filtering by rule ID, domain (case-insensitive), and decision
- Exclusion of error:transaction-end-before-headers entries
- Markdown output details: denied requests table, 50-row cap, policy flags
- Pretty output details: denied requests section, 20-row cap
- Source option and shouldLog callback behavior
Coverage improvement:
- logs-audit.ts: 0% to 100% statements (95.65% branches)
- Overall: 80.53% to 83.86% statements (+3.33%)
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent d0d77f8 commit d7c812d
1 file changed
+476
-0
lines changed
0 commit comments