bigbite / wp-cypress

WordPress end to end testing with Cypress.io.
MIT License
86 stars 19 forks source link

Include the fetch polyfill rather than use a cdn. #132

Closed balw closed 5 months ago

balw commented 5 months ago

Describe the bug The fetch pollyfill is currently brought in over a cdn https://unpkg.com/unfetch/dist/unfetch.umd.js

This is currently down and causes cypress tests to instantly fail.

To Reproduce Steps to reproduce the behavior: Run a cypress test using wp cypress and the test will fail if the resource https://unpkg.com/unfetch/dist/unfetch.umd.js is down.

Expected behavior Cypress test should not fail because it cannot use the fetch pollyfill.

GraemeF commented 5 months ago

I've just done this with:

  cy.readFile('node_modules/unfetch/dist/unfetch.umd.js').then((content) => {
    fetchPolyfill = content;
  });

Unfortunately it isn't possible to cy.intercept a cy.request so can't work around the outage without a change to wp-cypress.