mimic icon indicating copy to clipboard operation
mimic copied to clipboard

Error response doesn't work with Angular

Open ArielGueta opened this issue 3 years ago • 3 comments

When working with Angular and mocking an error response it doesn't work. For example:

image

Returns:

image

I debugged the Angular code and saw the issue is in the line :

1

ArielGueta avatar Aug 14 '20 05:08 ArielGueta

Could you make a small example to reproduce this? This is probably an issue with the requests engine (xhook) which I also maintain, however I need to make sure what exactly the issue is and how it conforms to the XHR spec.

I do know people who used mimic with angular and everything worked correctly so I'll check if they know anything about this.

morsdyce avatar Aug 16 '20 10:08 morsdyce

It only happens when mocking an error. Why xhr.response returns an empty string?

ArielGueta avatar Aug 16 '20 15:08 ArielGueta

It relates to quirks in the implementation that is trying to be standard compliant while also covering weird browser behavior.

I'll try triaging this and open an issue on xhook itself

On Sun, Aug 16, 2020, 18:48 Ariel Gueta [email protected] wrote:

It only happens when mocking an error. Why xhr.response returns an empty string?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/500tech/mimic/issues/300#issuecomment-674542866, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMWUIXZPLL4YMZLX2NHYWDSA75VDANCNFSM4P7EEMGA .

morsdyce avatar Aug 16 '20 16:08 morsdyce