pactum icon indicating copy to clipboard operation
pactum copied to clipboard

Custom expect handler does not print request and response when the assertion fails.

Open emfomy opened this issue 3 years ago • 1 comments

Describe the bug Most expect methods print the request and response when the assertion fails. However, the custom expect handler does not show these objects.

To Reproduce Steps to reproduce the behavior:

const spec = pactum.spec();
spec.get(url);
await spec.toss();
await spec.response().to.have._((ctx) => {
  assert.fail('error');
});

Expected behavior It should show the request and response as other methods do.

Software (please complete the following information):

  • OS: Linux
  • NodeJS: 16.1
  • Pactum: 3.0.19

emfomy avatar Sep 23 '21 07:09 emfomy

Thanks for Reporting. I will look into it.

ASaiAnudeep avatar Sep 23 '21 09:09 ASaiAnudeep