jameslnewell / xhr-mock

Utility for mocking XMLHttpRequest.
196 stars 48 forks source link

Calling overrideMimeType throws an unimplemented error #79

Open morsh opened 5 years ago

morsh commented 5 years ago

The following is not implemented and preventing requests from getting responses:

  overrideMimeType(mime: string): void {
    throw notImplementedError;
  }

Is anything being done with this?

jameslnewell commented 5 years ago

No efforts that I know of at the moment. Would you consider contributing it?

https://xhr.spec.whatwg.org/#the-overridemimetype()-method

morsh commented 5 years ago

Sorry, I ended up using another solution: https://github.com/berniegp/mock-xmlhttprequest

csimi commented 4 years ago

As far as I can see, xhr-mock doesn't do any parsing based on the mime type, so implementing this as a noop wouldn't cause any issues. Either way overrideMimeType is generally used to opt out of XML parsing which doesn't happen in this library.