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

Method NoError

assert/assertion_forward.go:1105–1110  ·  view source on GitHub ↗

NoError asserts that a function returned no error (i.e. `nil`). actualObj, err := SomeFunction() if a.NoError(err) { assert.Equal(t, expectedObj, actualObj) }

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

Source from the content-addressed store, hash-verified

1103// assert.Equal(t, expectedObj, actualObj)
1104// }
1105func (a *Assertions) NoError(err error, msgAndArgs ...interface{}) bool {
1106 if h, ok := a.t.(tHelper); ok {
1107 h.Helper()
1108 }
1109 return NoError(a.t, err, msgAndArgs...)
1110}
1111
1112// NoErrorf asserts that a function returned no error (i.e. `nil`).
1113//

Callers 1

TestNoErrorWrapperFunction · 0.45

Calls 2

NoErrorFunction · 0.70
HelperMethod · 0.65

Tested by 1

TestNoErrorWrapperFunction · 0.36