gavv / httpexpect

End-to-end HTTP and REST API testing for Go.
https://pkg.go.dev/github.com/gavv/httpexpect/v2
MIT License
2.53k stars 237 forks source link

TestReporterAndAssertionHandler implementation #419

Closed Darrellbor closed 1 year ago

Darrellbor commented 1 year ago

PR for #409

checked that:

Darrellbor commented 1 year ago

@gavv I attempted writing the test for this but I'm not too sure if it's what's required exactly...

coveralls commented 1 year ago

Coverage Status

coverage: 95.684% (+0.03%) from 95.655% when pulling 32b782ace55c6eab409f0f7d96b3f4e0cedd80e9 on Darrellbor:409-test_reporter_and_assertion_handler into 537a1273dc03f8269d9f55cbddc878432e2c80a7 on gavv:master.

Darrellbor commented 1 year ago

@gavv this is ready for review

gavv commented 1 year ago

Thanks for the patch.

I attempted writing the test for this but I'm not too sure if it's what's required exactly...

Yeah, actually this is not exactly what I was talking about. The key point is to check which reporter (or assertion handler) is used when failure happens on first or second response (first response inherits reporter from config, second from WithReporter on request).

I've reworked the test in a follow-up commit: 50355b80b56e935f740cc971d01df6023aebaf2f