MCPcopy
hub / github.com/stretchr/testify / Error

Method Error

require/require_forward.go:248–253  ·  view source on GitHub ↗

Error asserts that a function returned an error (i.e. not `nil`). actualObj, err := SomeFunction() a.Error(err)

(err error, msgAndArgs ...interface{})

Source from the content-addressed store, hash-verified

246// actualObj, err := SomeFunction()
247// a.Error(err)
248func (a *Assertions) Error(err error, msgAndArgs ...interface{}) {
249 if h, ok := a.t.(tHelper); ok {
250 h.Helper()
251 }
252 Error(a.t, err, msgAndArgs...)
253}
254
255// ErrorAs asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value.
256// This is a wrapper for errors.As.

Callers 15

TestImplementsFunction · 0.45
TestIsTypeFunction · 0.45
TestEqualFunction · 0.45
TestNotEqualFunction · 0.45
TestExactlyFunction · 0.45
TestNotNilFunction · 0.45
TestNilFunction · 0.45
TestTrueFunction · 0.45
TestFalseFunction · 0.45
TestContainsFunction · 0.45
TestNotContainsFunction · 0.45
TestPanicsFunction · 0.45

Calls 2

ErrorFunction · 0.70
HelperMethod · 0.65

Tested by 15

TestImplementsFunction · 0.36
TestIsTypeFunction · 0.36
TestEqualFunction · 0.36
TestNotEqualFunction · 0.36
TestExactlyFunction · 0.36
TestNotNilFunction · 0.36
TestNilFunction · 0.36
TestTrueFunction · 0.36
TestFalseFunction · 0.36
TestContainsFunction · 0.36
TestNotContainsFunction · 0.36
TestPanicsFunction · 0.36