Skip to content

Commit

Permalink
test: fix error check (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
kimdre authored Aug 7, 2024
1 parent cc176f5 commit d982693
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs
Submodule docs updated from a212f8 to 18b29e
8 changes: 4 additions & 4 deletions internal/webhook/parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ func TestParse(t *testing.T) {
r.Header.Set(GitlabTokenHeader, testSecret)
}
} else {
switch tc.expectedError {
case ErrHMACVerificationFailed:
switch {
case errors.Is(tc.expectedError, ErrHMACVerificationFailed):
r.Header.Set(GithubSignatureHeader, "sha256=invalid")
case ErrMissingSecurityHeader:
case errors.Is(tc.expectedError, ErrMissingSecurityHeader):
// do nothing
case ErrGitlabTokenVerificationFailed:
case errors.Is(tc.expectedError, ErrGitlabTokenVerificationFailed):
r.Header.Set(GitlabTokenHeader, "invalid")
}
}
Expand Down

0 comments on commit d982693

Please sign in to comment.