Simplify error assertion

Co-authored-by: Tim Möhlmann <muhlemmer@gmail.com>
This commit is contained in:
Ayato 2024-09-19 00:10:19 +09:00 committed by GitHub
parent 81c89c3949
commit 9af7d5e75e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -46,12 +46,7 @@ func TestDiscover(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got, err := Discover(context.Background(), tt.args.issuer, http.DefaultClient, tt.args.wellKnownUrl...)
if tt.wantErr != nil {
assert.ErrorIs(t, err, tt.wantErr)
return
}
require.NoError(t, err)
require.ErrorIs(t, err, tt.wantErr)
if tt.wantFields == nil {
return
}