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

Function NoError

require/require.go:1394–1402  ·  view source on GitHub ↗

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

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

Source from the content-addressed store, hash-verified

1392// require.Equal(t, expectedObj, actualObj)
1393// }
1394func NoError(t TestingT, err error, msgAndArgs ...interface{}) {
1395 if h, ok := t.(tHelper); ok {
1396 h.Helper()
1397 }
1398 if assert.NoError(t, err, msgAndArgs...) {
1399 return
1400 }
1401 t.FailNow()
1402}
1403
1404// NoErrorf asserts that a function returned no error (i.e. `nil`).
1405//

Callers 3

TestSuiteLoggingFunction · 0.92
NoErrorMethod · 0.70
TestNoErrorFunction · 0.70

Calls 3

NoErrorFunction · 0.92
HelperMethod · 0.65
FailNowMethod · 0.65

Tested by 2

TestSuiteLoggingFunction · 0.74
TestNoErrorFunction · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…