Open moty66 opened 1 year ago
I think this should be doable but you’ll need to write a few in-depth test cases to verify edge cases, specifically if you verify the response asynchronously (think in a process.nextTick). I’m unsure of the object referenced stability where request object’s are reused for efficient execution, but it’s worth a try.
For money reasons, it will be useful to access the original request and the whole response when verifying the body
I think adding a second parameter to the callback
verifyBody(resp.body, resp)
will not break anything and will be useful for advanced body verificationsCan I make a pull request for this feature