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

Function TestMountFallback_APIReturns404

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

Source from the content-addressed store, hash-verified

191}
192
193func TestMountFallback_APIReturns404(t *testing.T) {
194 dir := createTestTaskDir(t)
195 s := NewServer(Config{ScanDir: dir})
196
197 mux := http.NewServeMux()
198 s.mountFallback(mux)
199
200 req := httptest.NewRequest(http.MethodGet, "/api/tasks", nil)
201 rec := httptest.NewRecorder()
202
203 mux.ServeHTTP(rec, req)
204
205 if rec.Code != http.StatusNotFound {
206 t.Fatalf("expected 404 for /api/ path, got %d", rec.Code)
207 }
208}
209
210func captureStdout(t *testing.T, fn func()) string {
211 t.Helper()

Callers

nothing calls this directly

Calls 4

mountFallbackMethod · 0.95
createTestTaskDirFunction · 0.85
ServeHTTPMethod · 0.80
NewServerFunction · 0.70

Tested by

no test coverage detected