瀏覽代碼

test(cypress): show full response on insert_doc failure (#17257)

version-14
Ankush Menat 3 年之前
committed by GitHub
父節點
當前提交
9c5d6feec1
沒有發現已知的金鑰在資料庫的簽署中 GPG Key ID: 4AEE18F83AFDEB23
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. +6
    -1
      cypress/support/commands.js

+ 6
- 1
cypress/support/commands.js 查看文件

@@ -313,7 +313,12 @@ Cypress.Commands.add('insert_doc', (doctype, args, ignore_duplicate) => {
if (ignore_duplicate) {
status_codes.push(409);
}
expect(res.status).to.be.oneOf(status_codes);

let message = null;
if (ignore_duplicate && !status_codes.includes(res.status)) {
message = `Document insert failed, response: ${JSON.stringify(res, null, '\t')}`;
}
expect(res.status).to.be.oneOf(status_codes, message);
return res.body.data;
});
});


Loading…
取消
儲存