The response.render() method allows a callback to be provided as the second or third argument. Currently if this argument is used this library will not store the render data so assertions cannot be made on it.
This PR refactors the mock render() method to allow a callback to be provided as the second or third argument and if present will call it rather than ending the response. It is intended to closely follow the logic implemented by Express.
The
response.render()
method allows a callback to be provided as the second or third argument. Currently if this argument is used this library will not store the render data so assertions cannot be made on it.This PR refactors the mock
render()
method to allow a callback to be provided as the second or third argument and if present will call it rather than ending the response. It is intended to closely follow the logic implemented by Express.