update the PR

This commit is contained in:
Manendra Pal Singh
2025-12-03 17:52:37 +05:30
parent d68da8907c
commit 6b62f91c91
3 changed files with 13 additions and 1 deletions

View File

@@ -123,6 +123,16 @@ func TestRegisterSuccess(t *testing.T) {
if capturedModuleName != "test-module" {
t.Errorf("expected module_id in context to be 'test-module', got %v", capturedModuleName)
}
// Verifying /health endpoint registration
reqHealth := httptest.NewRequest(http.MethodGet, "/health", nil)
recHealth := httptest.NewRecorder()
mux.ServeHTTP(recHealth, reqHealth)
if status := recHealth.Code; status != http.StatusOK {
t.Errorf("handler for /health returned wrong status code: got %v want %v",
status, http.StatusOK)
}
}
// TestRegisterFailure tests scenarios where the handler registration should fail.