Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

Support simulated network delay #25

Open
kyranjamie opened this issue Nov 22, 2016 · 2 comments
Open

Support simulated network delay #25

kyranjamie opened this issue Nov 22, 2016 · 2 comments
Assignees

Comments

@kyranjamie
Copy link

kyranjamie commented Nov 22, 2016

Much like is offered with Stubby, it'd be a killer feature to be able to simulate slow network requests.

@jstoiko
Copy link
Contributor

jstoiko commented Nov 23, 2016

Sounds like a neat feature indeed!

Are you referring to using osprey-mock-service as CLI though? Because if using it in javascript, why not create a middleware that performs some kind of sleep() on each request?

@kyranjamie
Copy link
Author

I was indeed thinking of the CLI tool.

Perhaps a --simulate-delay flag, with an optional argument of how many ms – although for my usage a random 1-3 second delay would have the desired effect (testing loading spinners 😂)

I think it'd be nice to add a delay time for each response in the RAML, next to the example line – again, like Stubby – but guess this'd be non-standard and wouldn't fly.

Should be quite straight forward, a setTimeout might suffice?, will investigate a PR when I replace a stolen laptop

@sichvoge sichvoge self-assigned this Aug 14, 2017
@sichvoge sichvoge modified the milestone: 1.0.0 Aug 15, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants