Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

closes #79 implement overrideMimeType as a noop #107

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/xhr-mock/src/MockXMLHttpRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,9 @@ export default class MockXMLHttpRequest extends MockXMLHttpRequestEventTarget
}

overrideMimeType(mime: string): void {
throw notImplementedError;
if (this.readyState === MockXMLHttpRequest.LOADING || this.readyState === MockXMLHttpRequest.DONE) {
throw new MockError('xhr must not be LOADING or DONE.');
}
Copy link
Owner

@jameslnewell jameslnewell Nov 20, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we please explicitly check DONE just to make it a little clearer to understand what's going on at first sight 🙏

Should the passed mime affect the .responseType and related methods?

}

open(
Expand Down