Files
hiring-test-one/example/built-in/mock-async/mocks/delayed.js

12 lines
246 B
JavaScript
Raw Normal View History

2015-12-13 13:02:48 +00:00
module.exports = {
name: 'delayed response',
2015-12-13 13:02:48 +00:00
response: function (ctx) {
return new Promise((resolve, reject) => {
setTimeout(() => {
ctx.body = '<h1>You waited 2s for this</h1>'
2015-12-13 13:02:48 +00:00
resolve()
}, 2000)
})
}
}