(t *testing.T)
| 611 | } |
| 612 | |
| 613 | func TestReportCommand_OutputHTMLToFile(t *testing.T) { |
| 614 | tmpDir := createReportTestFiles(t) |
| 615 | outFile := filepath.Join(t.TempDir(), "report.html") |
| 616 | |
| 617 | resetReportFlags() |
| 618 | reportFormat = "html" |
| 619 | reportOut = outFile |
| 620 | |
| 621 | err := runReport(reportCmd, []string{tmpDir}) |
| 622 | if err != nil { |
| 623 | t.Fatalf("runReport failed: %v", err) |
| 624 | } |
| 625 | |
| 626 | content, err := os.ReadFile(outFile) |
| 627 | if err != nil { |
| 628 | t.Fatalf("Failed to read output file: %v", err) |
| 629 | } |
| 630 | |
| 631 | if !strings.Contains(string(content), "<!DOCTYPE html>") { |
| 632 | t.Error("Expected HTML file to contain DOCTYPE") |
| 633 | } |
| 634 | } |
| 635 | |
| 636 | // --- Edge cases --- |
| 637 |
nothing calls this directly
no test coverage detected