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(route2): fixed the issue with not being able to await a request body when providing static response stub #9059

Conversation

Andarist
Copy link
Contributor

@Andarist Andarist commented Nov 2, 2020

User facing changelog

Fixed an issue with not being able to await a request body when providing static response stub and using the experimentalNetworkStubbing.

Additional details

  • Why was this change necessary?

It's a bug fix.

  • What is affected by this change?

experimentalNetworkStubbing

How has the user experience changed?

N/A

PR Tasks

  • Have tests been added/updated?

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Nov 2, 2020

Thanks for taking the time to open a PR!

@CLAassistant
Copy link

CLAassistant commented Nov 2, 2020

CLA assistant check
All committers have signed the CLA.


return sendStaticResponse(request.res, route.staticResponse, request.onResponse!)
}

const ensureBody = (cb: () => void) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

right now every branch of the code that follows this declaration is using both ensureBody & emitReceived, so maybe you'd like to have this refactored somehow? If yes - let me know if you have anything in particular in mind. A change is not needed that much as the code is readable but maybe it would be good to ensure that both of those things will always be called for this logic rather if some new branches get added?

@Andarist Andarist changed the title Fixed an issue with not being able to await a request body when providing static response stub fix(route2): fixed the issue with not being able to await a request body when providing static response stub Nov 2, 2020
Copy link
Contributor

@flotwig flotwig left a comment

Choose a reason for hiding this comment

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

This looks good @Andarist, thanks for the PR. Don't worry about the refactor for now.

@flotwig flotwig merged commit f498b0a into cypress-io:develop Nov 4, 2020
54 checks passed
@Andarist Andarist deleted the fix/await-request-body-static-response-stub branch November 4, 2020 23:31
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Nov 9, 2020

Released in 5.6.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v5.6.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Nov 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants