diff --git a/cmd/files_test.go b/cmd/files_test.go index e540072..52224f0 100644 --- a/cmd/files_test.go +++ b/cmd/files_test.go @@ -108,20 +108,15 @@ func TestRunRollup(t *testing.T) { path = tempDir // Run the rollup - err = runRollup() + outputFile, err := runRollup() if err != nil { t.Fatalf("runRollup() failed: %v", err) } // Check if the output file was created - outputFiles, err := filepath.Glob(filepath.Join(tempDir, "*.rollup.md")) - if err != nil { - t.Fatalf("Failed to glob output files: %v", err) - } - if len(outputFiles) != 1 { - // List all files in the temp directory for debugging + if _, err := os.Stat(outputFile); os.IsNotExist(err) { files, _ := filepath.Glob(filepath.Join(tempDir, "*")) - t.Fatalf("Expected 1 output file, got %d. Files in directory: %v", len(outputFiles), files) + t.Fatalf("Output file %s not found. Files in directory: %v", outputFile, files) } // Read the content of the output file diff --git a/internal/scraper/scraper_test.go b/internal/scraper/scraper_test.go index ebe3a6d..76544dd 100644 --- a/internal/scraper/scraper_test.go +++ b/internal/scraper/scraper_test.go @@ -70,6 +70,9 @@ func TestGetOverrides(t *testing.T) { } func TestExtractContentWithCSS(t *testing.T) { + // Initialize logger for testing + logger = log.New(ioutil.Discard, "", 0) + html := `