(t *testing.T)
| 191 | } |
| 192 | |
| 193 | func 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 | |
| 210 | func captureStdout(t *testing.T, fn func()) string { |
| 211 | t.Helper() |
nothing calls this directly
no test coverage detected