Skip to content

Commit d286c62

Browse files
authored
tests: fix logged errors (#138)
1 parent ad6f7fe commit d286c62

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

client_test.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,13 @@ func TestClientUpdatesEnvironmentOnStartForLocalEvaluation(t *testing.T) {
9696
requestReceived.mu.Unlock()
9797
assert.Equal(t, req.URL.Path, "/api/v1/environment-document/")
9898
assert.Equal(t, fixtures.EnvironmentAPIKey, req.Header.Get("X-Environment-Key"))
99+
100+
rw.Header().Set("Content-Type", "application/json")
101+
rw.WriteHeader(http.StatusOK)
102+
_, err := io.WriteString(rw, fixtures.EnvironmentJson)
103+
if err != nil {
104+
panic(err)
105+
}
99106
}))
100107
defer server.Close()
101108

@@ -125,6 +132,13 @@ func TestClientUpdatesEnvironmentOnEachRefresh(t *testing.T) {
125132
actualEnvironmentRefreshCounter.mu.Unlock()
126133
assert.Equal(t, req.URL.Path, "/api/v1/environment-document/")
127134
assert.Equal(t, fixtures.EnvironmentAPIKey, req.Header.Get("X-Environment-Key"))
135+
136+
rw.Header().Set("Content-Type", "application/json")
137+
rw.WriteHeader(http.StatusOK)
138+
_, err := io.WriteString(rw, fixtures.EnvironmentJson)
139+
if err != nil {
140+
panic(err)
141+
}
128142
}))
129143
defer server.Close()
130144

0 commit comments

Comments
 (0)