Skip to content

Commit

Permalink
Merge pull request #837 from YakovL/uncaught-exceptions-handling
Browse files Browse the repository at this point in the history
Fix: failures on uncaught exception (should use Cypress.env, not process.env)
  • Loading branch information
r3kt-eth authored Aug 17, 2023
2 parents 6a4979f + ba98f3b commit 3d695f8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions support/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ configure({ testIdAttribute: 'data-testid' });

// dont fail tests on uncaught exceptions of websites
Cypress.on('uncaught:exception', () => {
if (!process.env.FAIL_ON_ERROR) {
if (!Cypress.env('FAIL_ON_ERROR')) {
return false;
}
});
Expand All @@ -14,7 +14,7 @@ Cypress.on('window:before:load', win => {
cy.stub(win.console, 'error').callsFake(message => {
cy.now('task', 'error', message);
// fail test on browser console error
if (process.env.FAIL_ON_ERROR) {
if (Cypress.env('FAIL_ON_ERROR')) {
throw new Error(message);
}
});
Expand Down

0 comments on commit 3d695f8

Please sign in to comment.