// ***********************************************************
// This example support/index.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************

import "cypress-real-events";

// When a command from ./commands is ready to use, import with `import './commands'` syntax
import './commands';

Cypress.on('uncaught:exception', (err, runnable) => {
  // For some reason, only when Cypress is running, we get uncaught exceptions
  // about self.postMessage, which causes several tests to
  // sometimes fail.  Ignore those errors.
  if (err.message.includes('self.postMessage is not a function')) {
    return false
  }
  // we still want to ensure there are no other unexpected
  // errors, so we let them fail the test
})
