Skip to content

Commit

Permalink
fix: failures on uncaught exception (should use Cypress.env, not proc…
Browse files Browse the repository at this point in the history
…ess.env)
  • Loading branch information
YakovL authored Aug 17, 2023
1 parent 39f92bd commit 54c5bd2
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 54c5bd2

Please sign in to comment.