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

Function TestReportCommand_OutputToFile

apps/cli/internal/cli/report_test.go:591–611  ·  view source on GitHub ↗

--- Output file tests ---

(t *testing.T)

Source from the content-addressed store, hash-verified

589// --- Output file tests ---
590
591func 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
613func TestReportCommand_OutputHTMLToFile(t *testing.T) {
614 tmpDir := createReportTestFiles(t)

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