mirror of
https://github.com/sonr-io/common.git
synced 2026-01-11 20:08:57 +00:00
20 lines
386 B
Go
20 lines
386 B
Go
package webauthn
|
|
|
|
import (
|
|
"errors"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func AssertIsProtocolError(t *testing.T, err error, errType, errDetails, errInfo string) {
|
|
var e *Error
|
|
|
|
require.True(t, errors.As(err, &e))
|
|
|
|
assert.Equal(t, errType, e.Type)
|
|
assert.Equal(t, errDetails, e.Details)
|
|
assert.Equal(t, errInfo, e.DevInfo)
|
|
}
|