You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
describe.only('get vs GET',()=>{context('cy.route',()=>{letpolyfill// grab fetch polyfill from remote URL, could be also from a local packagebefore(()=>{constpolyfillUrl='https://unpkg.com/unfetch/dist/unfetch.umd.js'cy.request(polyfillUrl).then((response)=>{polyfill=response.body})})it('works with GET',function(){cy.server()cy.route('get','/favorite-fruits').as('fruits')cy.visit('/',{onBeforeLoad(win){deletewin.fetchwin.eval(polyfill)win.fetch=win.unfetch},})cy.wait('@fruits')})it('works with get',function(){cy.server()cy.route('get','/favorite-fruits').as('fruits')cy.visit('/',{onBeforeLoad(win){deletewin.fetchwin.eval(polyfill)win.fetch=win.unfetch},})cy.wait('@fruits')})})context('cy.intercept',()=>{it('works with GET',function(){cy.intercept('GET','/favorite-fruits').as('fruits')cy.visit('/')cy.wait('@fruits')})// NOTE: does NOT work with "get"it.skip('works with get',function(){cy.intercept('get','/favorite-fruits').as('fruits')cy.visit('/')cy.wait('@fruits')})})})
if we run just the skipped test
it.only('works with get',function(){cy.intercept('get','/favorite-fruits').as('fruits')cy.visit('/')cy.wait('@fruits')})
The wait times out
The network call does happen
The text was updated successfully, but these errors were encountered:
The code for this is done in cypress-io/cypress#9324, but has yet to be released.
We'll update this issue and reference the changelog when it's released.
Cypress v6.0.0 with new
cy.intercept
should match the behavior ofcy.route
Reproducible example from https://github.com/cypress-io/cypress-example-recipes/tree/get-vs-GET
file examples/stubbing-spying__intercept/cypress/integration/spy-on-fetch-spec.js
if we run just the skipped test
The wait times out
The network call does happen
The text was updated successfully, but these errors were encountered: