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

Function TestRunSnapshot_GroupBy

apps/cli/internal/cli/snapshot_test.go:460–478  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

458}
459
460func TestRunSnapshot_GroupBy(t *testing.T) {
461 tmpDir := createSnapshotTestFiles(t)
462 resetSnapshotFlags()
463 snapshotGroupBy = "status"
464
465 output, err := captureSnapshotOutput(t, []string{tmpDir})
466 if err != nil {
467 t.Fatalf("runSnapshot failed: %v", err)
468 }
469
470 var result SnapshotOutput
471 if err := json.Unmarshal([]byte(output), &result); err != nil {
472 t.Fatalf("failed to parse JSON: %v", err)
473 }
474
475 if len(result.Groups) == 0 {
476 t.Error("expected grouped output, got empty groups")
477 }
478}
479
480func TestRunSnapshot_FileOutput(t *testing.T) {
481 tmpDir := createSnapshotTestFiles(t)

Callers

nothing calls this directly

Calls 4

createSnapshotTestFilesFunction · 0.85
resetSnapshotFlagsFunction · 0.85
captureSnapshotOutputFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected