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

Function TestHandleValidate

apps/cli/internal/web/handlers_test.go:409–426  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

407}
408
409func TestHandleValidate(t *testing.T) {
410 dir := createTestTaskDir(t)
411 dp := NewDataProvider(dir, false)
412
413 req := httptest.NewRequest(http.MethodGet, "/api/validate", nil)
414 rec := httptest.NewRecorder()
415
416 handleValidate(dp)(rec, req)
417
418 if rec.Code != http.StatusOK {
419 t.Fatalf("expected 200, got %d", rec.Code)
420 }
421
422 var result validator.ValidationResult
423 if err := json.Unmarshal(rec.Body.Bytes(), &result); err != nil {
424 t.Fatalf("invalid JSON: %v", err)
425 }
426}
427
428// PUT /api/tasks/{id} tests
429

Callers

nothing calls this directly

Calls 3

createTestTaskDirFunction · 0.85
NewDataProviderFunction · 0.85
handleValidateFunction · 0.70

Tested by

no test coverage detected