Skip to content

Commit

Permalink
Merge pull request #778 from Fenny/master
Browse files Browse the repository at this point in the history
🔨 fix proxy test
  • Loading branch information
Fenny authored Sep 14, 2020
2 parents 67a4cb1 + 1a3bd53 commit f3434e5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions middleware/proxy/proxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"net/http/httptest"
"strings"
"testing"
"time"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/utils"
Expand Down Expand Up @@ -56,6 +57,8 @@ func Test_Proxy(t *testing.T) {
utils.AssertEqual(t, nil, target.Listen(":3001"))
}()

time.Sleep(time.Second)

resp, err := target.Test(httptest.NewRequest("GET", "/", nil), 2000)
utils.AssertEqual(t, nil, err)
utils.AssertEqual(t, fiber.StatusTeapot, resp.StatusCode)
Expand Down Expand Up @@ -116,6 +119,8 @@ func Test_Proxy_After_With_Error(t *testing.T) {
utils.AssertEqual(t, nil, target.Listen(":3002"))
}()

time.Sleep(time.Second)

resp, err := target.Test(httptest.NewRequest("GET", "/", nil), 2000)
utils.AssertEqual(t, nil, err)
utils.AssertEqual(t, fiber.StatusTeapot, resp.StatusCode)
Expand Down

0 comments on commit f3434e5

Please sign in to comment.