Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable res.render() callback argument #197

Merged
merged 4 commits into from
Nov 7, 2019
Merged

Enable res.render() callback argument #197

merged 4 commits into from
Nov 7, 2019

Conversation

i-like-robots
Copy link
Contributor

@i-like-robots i-like-robots commented Nov 5, 2019

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.

@eugef
Copy link
Owner

eugef commented Nov 7, 2019

@i-like-robots thanks for your PR

@eugef eugef merged commit 223015c into eugef:master Nov 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants