ErrorContainsf asserts that a function returned an error (i.e. not `nil`) and that the error contains the specified substring. actualObj, err := SomeFunction() require.ErrorContainsf(t, err, expectedErrorSubString, "error message %s", "formatted")
(t TestingT, theError error, contains string, msg string, args ...interface{})
| 354 | // actualObj, err := SomeFunction() |
| 355 | // require.ErrorContainsf(t, err, expectedErrorSubString, "error message %s", "formatted") |
| 356 | func ErrorContainsf(t TestingT, theError error, contains string, msg string, args ...interface{}) { |
| 357 | if h, ok := t.(tHelper); ok { |
| 358 | h.Helper() |
| 359 | } |
| 360 | if assert.ErrorContainsf(t, theError, contains, msg, args...) { |
| 361 | return |
| 362 | } |
| 363 | t.FailNow() |
| 364 | } |
| 365 | |
| 366 | // ErrorIs asserts that at least one of the errors in err's chain matches target. |
| 367 | // This is a wrapper for errors.Is. |
no test coverage detected