Unexpected error when stubbing a request with cy.intercept(string, { headers: {} })
#16117
Labels
topic: cy.intercept()
type: regression
A bug that didn't appear until a specific Cy version release
v7.0.0 🐛
Issue present since 7.0.0
Current behavior
In Cypress 7, the
cy.intercept(url, routeMatcher)
overload was added. Now, when doing the following:or a variation, you get the following error:
Obviously this is not quite the case, since the object DOES have a
body
property.Desired behavior
2nd argument is treated as StaticResponse in this case
This check:
if (_.isString(matcher) && hasRouteMatcherKeys(handler)) {
should probably dohasONLYRouteMatcherKeys(handler)
to avoid this problem.Test code to reproduce
Versions
Cypress 7.0.0
The text was updated successfully, but these errors were encountered: