-
-
Notifications
You must be signed in to change notification settings - Fork 243
Closed
Labels
featureNew feature or requestNew feature or requesthelp wantedContributions are welcomeContributions are welcome
Milestone
Description
Add two new methods to Request:
- WithReporter(Reporter)
- WithAssertionHandler(AssertionHandler)
WithReporter(reporter) should be equivalent to:
WithAssertionHandler(DefaultAssertionHandler{
Reporter: reporter,
Formatter: r.config.Formatter,
})
WithAssertionHandler should update r.chain.handler with given handler. For that, we'll need to add new method chain.setHandler.
New methods should have documentation and tests. In tests, we should check that after these calls, request and it's newly created children (i.e. Response, its body, etc) start using new handler to report failures.
For that, we can create a mock reporter, pass it to request using WithReporter or WithAssertionHandler, then perform an assertion that will fail (req.Expect()....) and then check that the mock reporter is in failed state.
Metadata
Metadata
Assignees
Labels
featureNew feature or requestNew feature or requesthelp wantedContributions are welcomeContributions are welcome