-
Notifications
You must be signed in to change notification settings - Fork 1.7k
assert: add PanicsWithErrorIs #1350
Copy link
Copy link
Open
Labels
enhancementpkg-assertChange related to package testify/assertChange related to package testify/asserttype-errorIssue related to comparing values implementing the error interfaceIssue related to comparing values implementing the error interface
Metadata
Metadata
Assignees
Labels
enhancementpkg-assertChange related to package testify/assertChange related to package testify/asserttype-errorIssue related to comparing values implementing the error interfaceIssue related to comparing values implementing the error interface
Type
Fields
Give feedbackNo fields configured for issues without a type.
I have some code that wraps a database error with fmt.Errorf() and panics it. Now I want to assert that this error is paniced.
The current method PanicsWithError only compares the error message, but does not use a error chain comparison.
Example: