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.
Suppose we have the following in
onreadystatechange
:As
responseXML
is not implemented, xhr-mock outputs the messageThis 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 returningundefined
and making the code under test tryresponseText
, the mock just gives up.