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

Allows mocking XHR request with an invalid status response #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

borodovisin
Copy link

@borodovisin borodovisin commented Mar 14, 2022

Description

The PR makes a proposal to allow passing invalid status code/values on XHR mocking calls, also calls all the registered events listeners to the mocked instance.

Why are we making these changes?

To be able to enable unhappy test cases after mocking an endpoint. Now any kind of invalid status will be replaced with a 200 status code. There can be cases where we need to mock an endpoint setting the status code to something invalid like null.

Caveats

This is a proposed solution where the status code will keep values such as: [null, 0, false] and only will take the default one when is undefined. Can be a major change if some repos rely on status = null and are expecting a 200 status code in the response

@borodovisin borodovisin requested a review from a team as a code owner March 14, 2022 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants