(t *testing.T)
| 413 | } |
| 414 | |
| 415 | func TestExport_GraphJSON(t *testing.T) { |
| 416 | taskDir := createTestTaskDir(t) |
| 417 | outDir := filepath.Join(t.TempDir(), "export") |
| 418 | |
| 419 | err := exportWithMockFS(t, ExportConfig{ |
| 420 | OutputDir: outDir, |
| 421 | ScanDir: taskDir, |
| 422 | BasePath: "/", |
| 423 | Version: "test", |
| 424 | }) |
| 425 | if err != nil { |
| 426 | t.Fatalf("Export failed: %v", err) |
| 427 | } |
| 428 | |
| 429 | data, err := os.ReadFile(filepath.Join(outDir, "api", "graph.json")) |
| 430 | if err != nil { |
| 431 | t.Fatalf("failed to read graph.json: %v", err) |
| 432 | } |
| 433 | |
| 434 | var result map[string]any |
| 435 | if err := json.Unmarshal(data, &result); err != nil { |
| 436 | t.Fatalf("invalid JSON in graph.json: %v", err) |
| 437 | } |
| 438 | |
| 439 | if _, ok := result["nodes"]; !ok { |
| 440 | t.Error("expected 'nodes' in graph.json") |
| 441 | } |
| 442 | if _, ok := result["edges"]; !ok { |
| 443 | t.Error("expected 'edges' in graph.json") |
| 444 | } |
| 445 | } |
| 446 | |
| 447 | func TestExport_StatsJSON(t *testing.T) { |
| 448 | taskDir := createTestTaskDir(t) |
nothing calls this directly
no test coverage detected