[FEATURE REQUEST] httptest strict/require setting #1722
Labels
good first issue
A user wrote a good first issue with clear instructions
🚀 status:implemented
💡type:idea
Milestone
Is your feature request related to a problem? Please describe.
During testing I expected
github.com/kataras/iris/v12/httptest.Response.Status
to fail the test immediately if a different status is received. Therefore on subsequent lines I performed some operations that could result in a panic if let's say the response code was not as expected. It turns that it does not fail fast, it simply fails the test. This is becauseNew
configuresExpect
withReporter: httpexpect.NewAssertReporter(t)
.Describe the solution you'd like
I would like to be able to set
Reporter
tohttpexpect.NewRequireReporter(t)
. I think this could be done by extendingConfiguration
with a new field (e.g.Require bool
orStrict bool
) and then configuringhttpexpect.Config
using that value. I'd be happy to contribute this solution.Describe alternatives you've considered
I have considered copy pasting
github.com/kataras/iris/v12/httptest.New
and manually settingReporter
tohttpexpect.NewRequireReporter(t)
(wherehttpexpect
is actuallygithub.com/iris-contrib/httpexpect/v2
) by copyinghttptest.New
but I think that's not the right way to go about things.Additional context
None
The text was updated successfully, but these errors were encountered: