We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
DEPRECATED. The --mocks option and lws-mock-response modules were removed in v3.
To make a response asynchronous, use a response function which returns a Promise which resolves when complete.
response
Promise
module.exports = MockBase => class MyMockModule extends MockBase { mocks (options) { return [ { route: '/', responses: [ { response: function (ctx) { return new Promise((resolve, reject) => { setTimeout(() => { ctx.body = '<h1>You waited 2s for this</h1>' resolve() }, 2000) }) } } ] } ] } }