我有文件处理API,该文件处理API根据服务器上的队列接受文件和处理,处理所需的时间不是恒定的,这取决于队列的数量。因此,可能需要5分钟到一个小时,具体取决于队列处理...
下面是我测试的伪格式。
it(“文件上传测试”,功能(完成){
api.post(url)
.field('JobNumber', "1234")
.attach('File', '/testdata/doc.pdf')
.expect(200)
.end(function (err, res) {
console.log("........Response............")
expect(res.body.file.status ).to.equal("success")
});
我应该如何在Mocha测试中等待文件上传响应的状态为“成功”?