Report unexpected requests properly
luisobo opened this issue · 1 comments
If some request is made but it wasn't stubbed, Nocilla won't let that request hit the real world. In that case your test should fail.
At this moment Nocilla will return a response with a 500, the header X-Nocilla: Unexpected Request
and a body with a meaningful message about the error and how to solve it, including a snippet of code on how to stub the unexpected request.
Raising an exception wasn't working well with Kiwi, it didn't report failure.
The correct way of doing this is to integrate with test runners to make the current spec fail.
@luisobo is it possible to change that behavior? For example let the request execute.
That would be great to let it execute, record the response of real server, and output the all thing to an output.txt. That way you can reuse that output to stub. I have often this case when I work with a development or real test server which is a bit unstable and then you're stuck for hours until it's up again.
Is it something that is easily doable?
EDIT: just found issue #2 which is related to my comment