--- Output file tests ---
(t *testing.T)
| 589 | // --- Output file tests --- |
| 590 | |
| 591 | func TestReportCommand_OutputToFile(t *testing.T) { |
| 592 | tmpDir := createReportTestFiles(t) |
| 593 | outFile := filepath.Join(t.TempDir(), "report.md") |
| 594 | |
| 595 | resetReportFlags() |
| 596 | reportOut = outFile |
| 597 | |
| 598 | err := runReport(reportCmd, []string{tmpDir}) |
| 599 | if err != nil { |
| 600 | t.Fatalf("runReport failed: %v", err) |
| 601 | } |
| 602 | |
| 603 | content, err := os.ReadFile(outFile) |
| 604 | if err != nil { |
| 605 | t.Fatalf("Failed to read output file: %v", err) |
| 606 | } |
| 607 | |
| 608 | if !strings.Contains(string(content), "# Project Report") { |
| 609 | t.Error("Expected file to contain '# Project Report'") |
| 610 | } |
| 611 | } |
| 612 | |
| 613 | func TestReportCommand_OutputHTMLToFile(t *testing.T) { |
| 614 | tmpDir := createReportTestFiles(t) |
nothing calls this directly
no test coverage detected