Kaynağa Gözat

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

version-14
Ankush Menat 3 yıl önce
committed by GitHub
ebeveyn
işleme
9c5d6feec1
Veri tabanında bu imza için bilinen anahtar bulunamadı GPG Anahtar Kimliği: 4AEE18F83AFDEB23
1 değiştirilmiş dosya ile 6 ekleme ve 1 silme
  1. +6
    -1
      cypress/support/commands.js

+ 6
- 1
cypress/support/commands.js Dosyayı Görüntüle

@@ -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;
});
});


Yükleniyor…
İptal
Kaydet