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

fix(testing): MockResponse404 is not ok #2420

Merged
merged 1 commit into from
May 6, 2020
Merged

fix(testing): MockResponse404 is not ok #2420

merged 1 commit into from
May 6, 2020

Conversation

luchsamapparat
Copy link
Contributor

@luchsamapparat luchsamapparat commented May 6, 2020

MockResponse404 extends from MockResponse which sets ok to true by default. However, ok should only be true, if the status code is within the 2xx range.

Alternatively, we could change the ok property of MockResponse to a getter:

export class MockResponse {
  get ok() {
    return this.status >= 200 && this.status <= 299
  }
}

However, by doing that ok would be readonly and that is probably a breaking change. 🤔

@manucorporat manucorporat merged commit 43d30dc into stenciljs:master May 6, 2020
@manucorporat
Copy link
Contributor

Thanks for the PR!

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.

None yet

2 participants