wiremock-rs
wiremock-rs copied to clipboard
More helpful failed verifications panic messages
Hello, I think having clearer failed verification messages would make debugging multiple chained .and(matcher) calls easier. For example: Mock::given(header_exists("X-Postmark-Server-Token")) .and(header("Content-Type", "application/json")) .and(path("/email")) .and(method("POST")) .and(SendEmailBodyMatcher) Fails with: thread 'email_client::tests::send_email_sends_the_expected_request' panicked at 'Verifications failed:
- Mock #0. Expected range of matching incoming requests: == 1 Number of matched incoming requests: 0
As opposed to specifying which matcher in particular failed.
This would be very useful!
I agree this would be quite useful, but there are some challenges to the implementation 😅
For the time being, my recommendation would be to always use the named
method on your Mock
s to make it easier to pinpoint what didn't work as expected!