Unimplemented error thrown from .responseXML precludes workarounds
IanDavey opened this issue · 2 comments
IanDavey commented
Suppose we have the following in onreadystatechange
:
let result = this.responseXML || this.responseText || this.response;
As responseXML
is not implemented, xhr-mock outputs the message This feature hasn't been implmented yet. Please submit an Issue or Pull Request on Github.
However, in the snippet above we have a workaround, as long as we're not expecting an XML Document
in our tests. Rather than just returning undefined
and making the code under test try responseText
, the mock just gives up.
jameslnewell commented
Makes sense. Looks easy to implement. Want to have a crack at it?
K0d1Lu commented
I'm facing the same problem, could assign me this issue ?