Added: Bug Fixes

This commit is contained in:
shreyvishal
2025-06-25 16:30:47 +05:30
parent 02c69b98b6
commit 7a0a78d43d
12 changed files with 405 additions and 104 deletions

View File

@@ -118,7 +118,15 @@ 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.
@@ -172,4 +180,4 @@ func TestRegisterFailure(t *testing.T) {
}
})
}
}
}