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
Mocking a route with an empty response body doesn't show the XHR call as being stubbed #8018
Comments
Yeah, I feel like this is solely a visual bug in the Test Runner's Command Log. This test passes, but it doesn't show up as So, I don't this is actually affecting any behavior. it('fails to show as stub in command log', () => {
cy.visit('https://example.cypress.io/commands/aliasing')
cy.server()
cy.route('GET', 'comments/*', '').as('getComment')
cy.get('.network-btn').click()
cy.wait('@getComment').then((xhr) => {
expect(xhr.response.body).to.eq('')
})
}) Looks like a check here that is returning false when the response is |
Opened PR here: #8033 |
The code for this is done in cypress-io/cypress#8033, but has yet to be released. |
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
Current behavior:
Mocking a route with an empty response body
incorrectly shows the XHR call not being stubbed:
Mocking the response body with a non-falsy value does produce the correct outcome:
**Note: the request IS marked as stubbed in the Console in both cases:
Desired behavior:
Both examples should show the call as
(xhr stub)
in the test runner.Test code to reproduce
Versions
Cypress@4.10, node 12.16.3, macOS 10.15.5
The text was updated successfully, but these errors were encountered: