(t *testing.T)
| 445 | } |
| 446 | |
| 447 | func TestExport_StatsJSON(t *testing.T) { |
| 448 | taskDir := createTestTaskDir(t) |
| 449 | outDir := filepath.Join(t.TempDir(), "export") |
| 450 | |
| 451 | err := exportWithMockFS(t, ExportConfig{ |
| 452 | OutputDir: outDir, |
| 453 | ScanDir: taskDir, |
| 454 | BasePath: "/", |
| 455 | Version: "test", |
| 456 | }) |
| 457 | if err != nil { |
| 458 | t.Fatalf("Export failed: %v", err) |
| 459 | } |
| 460 | |
| 461 | data, err := os.ReadFile(filepath.Join(outDir, "api", "stats.json")) |
| 462 | if err != nil { |
| 463 | t.Fatalf("failed to read stats.json: %v", err) |
| 464 | } |
| 465 | |
| 466 | var result map[string]any |
| 467 | if err := json.Unmarshal(data, &result); err != nil { |
| 468 | t.Fatalf("invalid JSON in stats.json: %v", err) |
| 469 | } |
| 470 | |
| 471 | totalTasks, ok := result["total_tasks"].(float64) |
| 472 | if !ok { |
| 473 | t.Fatal("expected total_tasks in stats.json") |
| 474 | } |
| 475 | if int(totalTasks) != 2 { |
| 476 | t.Errorf("expected 2 total tasks, got %d", int(totalTasks)) |
| 477 | } |
| 478 | } |
| 479 | |
| 480 | func TestPatchIndexHTML_RelativePaths(t *testing.T) { |
| 481 | input := `<head><script src="/assets/app.js"></script></head>` |
nothing calls this directly
no test coverage detected