You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is no built in support for delays, but it's easy to do yourself with a callback. You can do that like so:
mockServer.forGet('/resource')// Match GET + path// ... any other matching you want.thenCallback(async(req)=>{// Await a 1000ms promise delay:awaitnewPromise((resolve)=>setTimeout(resolve,1000));// Then return the response value:return{status: 200,json: {hello: "world"}};});
I'm open to adding built-in support for delays too, it's definitely an interesting idea, but it needs a little design work to integrate it neatly into the current model. I'll keep an eye on it and see if I can find a good solution there soon.
I want to know how to delay the response and how to filter the request.
Example: mock-http-server
How do I use
filter
anddelay
with Mockttp?The text was updated successfully, but these errors were encountered: