@@ -123,7 +123,10 @@ func TestHandler_BodyParserValidator(t *testing.T) {
123123 req = httptest .NewRequest ("POST" , test .path , nil )
124124 }
125125
126- resp , _ := app .Test (req )
126+ resp , err := app .Test (req )
127+ if err != nil {
128+ t .Fatalf ("app.Test failed: %v" , err )
129+ }
127130 if test .expectedStatus != resp .StatusCode {
128131 t .Errorf ("Expected status code %d, got %d" , test .expectedStatus , resp .StatusCode )
129132 }
@@ -151,6 +154,11 @@ func TestHandler_QueryParserValidator(t *testing.T) {
151154 path string
152155 expectedStatus int
153156 }{
157+ {
158+ description : "Invalid query parameters - non-integer age" ,
159+ path : "/test?name=John&age=abc" ,
160+ expectedStatus : fiber .StatusBadRequest ,
161+ },
154162 {
155163 description : "Valid query parameters" ,
156164 path : "/test?name=John&age=25" ,
@@ -177,7 +185,10 @@ func TestHandler_QueryParserValidator(t *testing.T) {
177185 t .Run (test .description , func (t * testing.T ) {
178186 req := httptest .NewRequest ("GET" , test .path , nil )
179187
180- resp , _ := app .Test (req )
188+ resp , err := app .Test (req )
189+ if err != nil {
190+ t .Fatalf ("app.Test failed: %v" , err )
191+ }
181192 if test .expectedStatus != resp .StatusCode {
182193 t .Errorf ("Expected status code %d, got %d" , test .expectedStatus , resp .StatusCode )
183194 }
@@ -231,7 +242,10 @@ func TestHandler_ParamsParserValidator(t *testing.T) {
231242 t .Run (test .description , func (t * testing.T ) {
232243 req := httptest .NewRequest ("GET" , test .path , nil )
233244
234- resp , _ := app .Test (req )
245+ resp , err := app .Test (req )
246+ if err != nil {
247+ t .Fatalf ("app.Test failed: %v" , err )
248+ }
235249 if test .expectedStatus != resp .StatusCode {
236250 t .Errorf ("Expected status code %d, got %d" , test .expectedStatus , resp .StatusCode )
237251 }
0 commit comments