-
Notifications
You must be signed in to change notification settings - Fork 59
Add support for delaying responses to mimic real APIs. #29
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
base: master
Are you sure you want to change the base?
Conversation
Wondering what your thoughts might be on this. I'm not too familiar with coffeescript/sinon, so I may need help testing if approved. |
@@ -25,7 +25,9 @@ walker = (app, resourceGroups) -> | |||
headerValue = value['value'] | |||
res.setHeader headerName, headerValue | |||
res.setHeader 'Content-Length', Buffer.byteLength(response.body) | |||
res.send response.status, response.body | |||
setTimeout ( -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not familiar with coffeescript, but this does produce some weirdness when compiled:
return setTimeout((function() {
return res.send(response.status, response.body);
}), delay);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks normal to me. :)
👍 |
Wondering when this could be merged to master? |
This would be a very useful feature. I'd rather be able to get it from NPM than having point at austburn:api-response-delay |
No description provided.