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

Function TestPrintBanner_Default

apps/cli/internal/web/server_test.go:231–251  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

229}
230
231func TestPrintBanner_Default(t *testing.T) {
232 dir := createTestTaskDir(t)
233 s := NewServer(Config{Port: 8080, ScanDir: dir})
234
235 output := captureStdout(t, func() {
236 s.printBanner()
237 })
238
239 if !strings.Contains(output, "http://localhost:8080") {
240 t.Errorf("expected banner to show port 8080, got %q", output)
241 }
242 if !strings.Contains(output, fmt.Sprintf("Watching %s", dir)) {
243 t.Errorf("expected banner to show scan dir, got %q", output)
244 }
245 if strings.Contains(output, "Read-only") {
246 t.Error("unexpected read-only message in default mode")
247 }
248 if strings.Contains(output, "Dev mode") {
249 t.Error("unexpected dev mode message in default mode")
250 }
251}
252
253func TestPrintBanner_ReadOnlyAndDev(t *testing.T) {
254 dir := createTestTaskDir(t)

Callers

nothing calls this directly

Calls 5

printBannerMethod · 0.95
createTestTaskDirFunction · 0.85
captureStdoutFunction · 0.85
ErrorMethod · 0.80
NewServerFunction · 0.70

Tested by

no test coverage detected