import { describe, expect, test } from 'bun:test'; import { formatResult } from './module-health'; describe('module health rendering — the waiver annotation', () => { test('a waived no-checks module renders the waiver beside the verdict, not instead of it', () => { const output = formatResult({ moduleId: 'namecheap', status: 'no-checks', checks: [], waiver: { reason: 'API-only: a real check is hard and may not be worth forcing', by: 'peba', at: '2026-09-09', }, }); // The unmeasured verdict is still stated. expect(output).toContain('no health check defined'); // The annotation names the human's words, who, and when. expect(output).toContain( 'waived: API-only: a real check is hard and may not be worth forcing (by peba at 2026-09-09)', ); }); test('a no-checks module without a waiver renders no waiver line', () => { const output = formatResult({ moduleId: 'iptables', status: 'no-checks', checks: [], }); expect(output).toContain('no health check defined'); expect(output).not.toContain('waived:'); }); });