Skip to content

Instantly share code, notes, and snippets.

@ryanjyost
Created March 19, 2020 01:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanjyost/2a3af39dc1b18a423047a3923192c430 to your computer and use it in GitHub Desktop.
Save ryanjyost/2a3af39dc1b18a423047a3923192c430 to your computer and use it in GitHub Desktop.
support/index
Cypress.on("window:before:load", win => {
cy.stub(win.console, "error", msg => {
if (msg.includes("This is an error")) {
return null;
}
cy.now("task", "error", msg);
throw new Error(msg);
});
cy.stub(win.console, "warn", msg => {
cy.now("task", "warn", msg);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment