MCPcopy Index your code
hub / github.com/gavv/httpexpect / AssertionHandler

Interface AssertionHandler

assertion.go:221–231  ·  view source on GitHub ↗

AssertionHandler takes care of formatting and reporting test Failure or Success. You can log every performed assertion, or report only failures. You can implement custom formatting, for example, provide a JSON output for ulterior processing. Usually you don't need to implement AssertionHandler; in

Source from the content-addressed store, hash-verified

219// Usually you don't need to implement AssertionHandler; instead you can implement
220// Reporter, which is much simpler, and use it with DefaultAssertionHandler.
221type AssertionHandler interface {
222 // Invoked every time when an assertion succeeded.
223 // May ignore failure, or log it, e.g. using t.Logf().
224 Success(*AssertionContext)
225
226 // Invoked every time when an assertion failed.
227 // Handling depends on Failure.Severity field:
228 // - for SeverityError, reports failure to testing suite, e.g. using t.Errorf()
229 // - for SeverityLog, ignores failure, or logs it, e.g. using t.Logf()
230 Failure(*AssertionContext, *AssertionFailure)
231}
232
233// DefaultAssertionHandler is default implementation for AssertionHandler.
234//

Callers 4

leaveMethod · 0.65
TestAssertion_HandlerFunction · 0.65
leaveMethod · 0.65
TestAssertion_HandlerFunction · 0.65

Implementers 4

errorSuppressore2e/context_test.go

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…