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

Function TestFeedCommand_PlainText

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

Source from the content-addressed store, hash-verified

120}
121
122func TestFeedCommand_PlainText(t *testing.T) {
123 resetFeedFlags()
124 noColor = true
125 defer func() { noColor = false }()
126
127 oldGitLog := gitLogFunc
128 gitLogFunc = func(_ string, _ []string) (string, error) {
129 return sampleGitLogOutput, nil
130 }
131 defer func() { gitLogFunc = oldGitLog }()
132
133 oldGitShow := gitShowFunc
134 gitShowFunc = noopGitShow
135 defer func() { gitShowFunc = oldGitShow }()
136
137 output, err := captureFeedOutput(t, func() error {
138 return runFeed(feedCmd, nil)
139 })
140 if err != nil {
141 t.Fatalf("unexpected error: %v", err)
142 }
143
144 if !strings.Contains(output, "Recent task activity") {
145 t.Error("expected header line in output")
146 }
147 if !strings.Contains(output, "2026-02-28 10:30") {
148 t.Error("expected date in output")
149 }
150 if !strings.Contains(output, "Alice") {
151 t.Error("expected author in output")
152 }
153 if !strings.Contains(output, "[Modified]") {
154 t.Error("expected [Modified] status tag")
155 }
156 if !strings.Contains(output, "[Added] tasks/") {
157 t.Error("expected [Added] file entry")
158 }
159 if !strings.Contains(output, "042") {
160 t.Error("expected task ID 042 in output")
161 }
162}
163
164func TestFeedCommand_JSON(t *testing.T) {
165 resetFeedFlags()

Callers

nothing calls this directly

Calls 4

resetFeedFlagsFunction · 0.85
captureFeedOutputFunction · 0.85
runFeedFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected