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

Function TestFeedCommand_EmptyFeed_JSON

apps/cli/internal/cli/feed_test.go:326–350  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

324}
325
326func TestFeedCommand_EmptyFeed_JSON(t *testing.T) {
327 resetFeedFlags()
328 feedFormat = "json"
329
330 oldGitLog := gitLogFunc
331 gitLogFunc = func(_ string, _ []string) (string, error) {
332 return "", nil
333 }
334 defer func() { gitLogFunc = oldGitLog }()
335
336 oldGitShow := gitShowFunc
337 gitShowFunc = noopGitShow
338 defer func() { gitShowFunc = oldGitShow }()
339
340 output, err := captureFeedOutput(t, func() error {
341 return runFeed(feedCmd, nil)
342 })
343 if err != nil {
344 t.Fatalf("unexpected error: %v", err)
345 }
346
347 if strings.TrimSpace(output) != "[]" {
348 t.Errorf("expected empty JSON array, got: %s", output)
349 }
350}
351
352func TestFeedCommand_InvalidFormat(t *testing.T) {
353 resetFeedFlags()

Callers

nothing calls this directly

Calls 3

resetFeedFlagsFunction · 0.85
captureFeedOutputFunction · 0.85
runFeedFunction · 0.85

Tested by

no test coverage detected