MCPcopy Create free account
hub / github.com/driangle/taskmd / TestReportCommand_OutputHTMLToFile

Function TestReportCommand_OutputHTMLToFile

apps/cli/internal/cli/report_test.go:613–634  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

611}
612
613func 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

Callers

nothing calls this directly

Calls 4

createReportTestFilesFunction · 0.85
resetReportFlagsFunction · 0.85
runReportFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected