--- Command-level tests ---
(t *testing.T)
| 356 | // --- Command-level tests --- |
| 357 | |
| 358 | func TestRunSnapshot_JSONOutput(t *testing.T) { |
| 359 | tmpDir := createSnapshotTestFiles(t) |
| 360 | resetSnapshotFlags() |
| 361 | |
| 362 | output, err := captureSnapshotOutput(t, []string{tmpDir}) |
| 363 | if err != nil { |
| 364 | t.Fatalf("runSnapshot failed: %v", err) |
| 365 | } |
| 366 | |
| 367 | var result SnapshotOutput |
| 368 | if err := json.Unmarshal([]byte(output), &result); err != nil { |
| 369 | t.Fatalf("failed to parse JSON: %v\noutput: %s", err, output) |
| 370 | } |
| 371 | |
| 372 | if len(result.Tasks) != 4 { |
| 373 | t.Errorf("expected 4 tasks, got %d", len(result.Tasks)) |
| 374 | } |
| 375 | } |
| 376 | |
| 377 | func TestRunSnapshot_YAMLOutput(t *testing.T) { |
| 378 | tmpDir := createSnapshotTestFiles(t) |
nothing calls this directly
no test coverage detected