Skip to content

Commit

Permalink
Fix ordering of reset character when colorizing error output
Browse files Browse the repository at this point in the history
  • Loading branch information
Stein Fletcher committed May 15, 2021
1 parent 503426c commit c0faa48
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apitest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func TestApiTest_ResponseBody(t *testing.T) {
apitest.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
_, _ = w.Write([]byte(`{"id": "1234", "name": "Andy"}`))
w.WriteHeader(http.StatusOK)
}).
}).ColorizeErrors().
Get("/user/1234").
Expect(t).
Body(`{"id": "1234", "name": "Andy"}`).
Expand Down
2 changes: 1 addition & 1 deletion assert.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func (a DefaultVerifier) colorize(message string) string {
if runtime.GOOS == "windows" || !a.ColorizeErrors {
return message
}
return "\033[0m" + message + "\033[31m"
return "\033[31m" + message + "\033[0m"
}

// Fail reports a failure
Expand Down

0 comments on commit c0faa48

Please sign in to comment.