【发布时间】:2020-06-26 15:58:16
【问题描述】:
我知道 nock 允许像我在这里一样为同一端点排队模拟:
nock('https://example.test')
.get('/')
.delayConnection(400)
.reply(200, MockApiResponses.proccessing) //response on first get
.get('/')
.delayConnection(150)
.reply(200, MockApiResponses.goodRetrieve) //response on second
我希望模拟一个场景,其中我的第一个回复在前 5-20 分钟内发送,然后是最后一个。但是,我不想将这些获取、延迟和回复中的 100 个链接在一起。
【问题讨论】: