Skip to content

Commit

Permalink
tests: fix logged errors (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
gagantrivedi authored Sep 2, 2024
1 parent ad6f7fe commit d286c62
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,13 @@ func TestClientUpdatesEnvironmentOnStartForLocalEvaluation(t *testing.T) {
requestReceived.mu.Unlock()
assert.Equal(t, req.URL.Path, "/api/v1/environment-document/")
assert.Equal(t, fixtures.EnvironmentAPIKey, req.Header.Get("X-Environment-Key"))

rw.Header().Set("Content-Type", "application/json")
rw.WriteHeader(http.StatusOK)
_, err := io.WriteString(rw, fixtures.EnvironmentJson)
if err != nil {
panic(err)
}
}))
defer server.Close()

Expand Down Expand Up @@ -125,6 +132,13 @@ func TestClientUpdatesEnvironmentOnEachRefresh(t *testing.T) {
actualEnvironmentRefreshCounter.mu.Unlock()
assert.Equal(t, req.URL.Path, "/api/v1/environment-document/")
assert.Equal(t, fixtures.EnvironmentAPIKey, req.Header.Get("X-Environment-Key"))

rw.Header().Set("Content-Type", "application/json")
rw.WriteHeader(http.StatusOK)
_, err := io.WriteString(rw, fixtures.EnvironmentJson)
if err != nil {
panic(err)
}
}))
defer server.Close()

Expand Down

0 comments on commit d286c62

Please sign in to comment.