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

Function TestRunSnapshot_JSONOutput

apps/cli/internal/cli/snapshot_test.go:358–375  ·  view source on GitHub ↗

--- Command-level tests ---

(t *testing.T)

Source from the content-addressed store, hash-verified

356// --- Command-level tests ---
357
358func 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
377func TestRunSnapshot_YAMLOutput(t *testing.T) {
378 tmpDir := createSnapshotTestFiles(t)

Callers

nothing calls this directly

Calls 3

createSnapshotTestFilesFunction · 0.85
resetSnapshotFlagsFunction · 0.85
captureSnapshotOutputFunction · 0.85

Tested by

no test coverage detected