Skip to content

Commit 0992f5e

Browse files
committed
chore: fix body content test
1 parent be1e312 commit 0992f5e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pkg/networking/middleware/response_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ func Test_ResponseMiddleware(t *testing.T) {
4747
assert.Nil(t, err)
4848
default:
4949
w.WriteHeader(http.StatusOK)
50+
_, err := w.Write([]byte("hello"))
51+
assert.Nil(t, err)
5052
}
5153
})
5254
server := httptest.NewServer(handler)
@@ -242,7 +244,7 @@ func Test_ResponseMiddleware(t *testing.T) {
242244

243245
bodyBytes, err := io.ReadAll(res.Body)
244246
assert.NoError(t, err, "Body should be readable")
245-
assert.NotNil(t, bodyBytes, "Should be able to read body")
247+
assert.NotEmpty(t, bodyBytes, "Should be able to read body")
246248

247249
err = res.Body.Close()
248250
assert.NoError(t, err, "Body should close without errors")

0 commit comments

Comments
 (0)