Skip to content

Commit

Permalink
github tests: make failure more readable
Browse files Browse the repository at this point in the history
  • Loading branch information
marco-m-pix4d committed Sep 25, 2024
1 parent 9bc5442 commit f981d50
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion github/commitstatus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,9 @@ func TestGitHubStatusFailureIntegration(t *testing.T) {
ghStatus := github.NewCommitStatus(target, tc.token, tc.owner, tc.repo, "dummy-context", log)
err := ghStatus.Add(tc.sha, state, "dummy-url", "dummy-desc")

assert.Error(t, err, tc.wantErr)
assert.Assert(t, err != nil)
haveErr := err.Error()
assert.Equal(t, haveErr, tc.wantErr)
var ghError *github.StatusError
if !errors.As(err, &ghError) {
t.Fatalf("\nhave: %s\nwant: type github.StatusError", err)
Expand Down

0 comments on commit f981d50

Please sign in to comment.