Skip to content

Commit 6ff2b07

Browse files
committed
test: wait before sending response in logger tests
1 parent da9b4d5 commit 6ff2b07

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

middlewares/logger_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,20 @@ func TestNewLoggerWithConfig(t *testing.T) {
7979
k.Use(NewLoggerWithConfig(cfg))
8080

8181
k.Get("/", func(c *kid.Context) {
82+
time.Sleep(time.Millisecond)
8283
c.String(http.StatusOK, "Ok")
8384
})
8485

8586
k.Get("/server-error", func(c *kid.Context) {
87+
time.Sleep(time.Millisecond)
8688
c.String(http.StatusInternalServerError, "Internal Server Error")
8789
})
8890

91+
k.Get("/not-found", func(c *kid.Context) {
92+
time.Sleep(time.Millisecond)
93+
c.String(http.StatusNotFound, "Not Found")
94+
})
95+
8996
testCases := []struct {
9097
path string
9198
msg string

0 commit comments

Comments
 (0)