Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Request.WithReporter and WithAssertionHandler #234

Closed
gavv opened this issue Jan 24, 2023 · 5 comments
Closed

Add Request.WithReporter and WithAssertionHandler #234

gavv opened this issue Jan 24, 2023 · 5 comments
Labels
feature New feature or request help wanted Contributions are welcome
Milestone

Comments

@gavv
Copy link
Owner

gavv commented Jan 24, 2023

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.

@gavv gavv added feature New feature or request help wanted Contributions are welcome labels Jan 24, 2023
@kairemor
Copy link
Contributor

I can go on this?

@gavv
Copy link
Owner Author

gavv commented Jan 26, 2023

Sure!

@gavv gavv added the waiting reply Waiting for reply from reporter or contributor label Feb 24, 2023
@gavv
Copy link
Owner Author

gavv commented Mar 3, 2023

@kairemor Hi, do you still have plans on this?

@gavv
Copy link
Owner Author

gavv commented Mar 22, 2023

Unassigning, so that someone could pick this up. However feel free to ping me if you'll want to work on it.

@gavv gavv removed the waiting reply Waiting for reply from reporter or contributor label Mar 22, 2023
@gavv
Copy link
Owner Author

gavv commented Apr 25, 2023

Landed

@gavv gavv closed this as completed Apr 25, 2023
@gavv gavv added this to the v2 milestone Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request help wanted Contributions are welcome
Projects
None yet
Development

No branches or pull requests

2 participants