Skip to content

Commit e668ac4

Browse files
committed
adding support for reverse proxy in tests
1 parent 1223d2f commit e668ac4

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/webserver_test.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ var _ = func() bool {
1919
func TestFakeToUpCodeCoverage(t *testing.T) {
2020
gin.SetMode(gin.TestMode)
2121

22+
// adding support for proxy for tests
23+
if isEnvExist("TIBIADATA_PROXY") {
24+
TibiaDataProxyDomain = "https://" + getEnv("TIBIADATA_PROXY", "www.tibia.com") + "/"
25+
}
26+
2227
w := httptest.NewRecorder()
2328
c, _ := gin.CreateTestContext(w)
2429

@@ -32,8 +37,6 @@ func TestFakeToUpCodeCoverage(t *testing.T) {
3237
assert := assert.New(t)
3338

3439
tibiaCharactersCharacterV3(c)
35-
// writing to log for debugging
36-
t.Log(w)
3740
assert.Equal(http.StatusOK, w.Code)
3841

3942
w = httptest.NewRecorder()
@@ -53,8 +56,6 @@ func TestFakeToUpCodeCoverage(t *testing.T) {
5356
}
5457

5558
tibiaCreaturesCreatureV3(c)
56-
// writing to log for debugging
57-
t.Log(w)
5859
assert.Equal(http.StatusOK, w.Code)
5960

6061
w = httptest.NewRecorder()
@@ -74,8 +75,6 @@ func TestFakeToUpCodeCoverage(t *testing.T) {
7475
}
7576

7677
tibiaGuildsGuildV3(c)
77-
// writing to log for debugging
78-
t.Log(w)
7978
assert.Equal(http.StatusOK, w.Code)
8079

8180
w = httptest.NewRecorder()

0 commit comments

Comments
 (0)