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

Function TestMountFallback_NonRootPath

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

Source from the content-addressed store, hash-verified

169}
170
171func TestMountFallback_NonRootPath(t *testing.T) {
172 dir := createTestTaskDir(t)
173 s := NewServer(Config{ScanDir: dir})
174
175 mux := http.NewServeMux()
176 s.mountFallback(mux)
177
178 req := httptest.NewRequest(http.MethodGet, "/board", nil)
179 rec := httptest.NewRecorder()
180
181 mux.ServeHTTP(rec, req)
182
183 if rec.Code != http.StatusOK {
184 t.Fatalf("expected 200 for non-root path, got %d", rec.Code)
185 }
186
187 body := rec.Body.String()
188 if !strings.Contains(body, "taskmd") {
189 t.Error("expected fallback HTML for non-root path")
190 }
191}
192
193func TestMountFallback_APIReturns404(t *testing.T) {
194 dir := createTestTaskDir(t)

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected