JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 45029
  • Score
    100M100P100Q162258F
  • License MIT

fail cypress test on console error

Package Exports

  • cypress-fail-on-console-error

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (cypress-fail-on-console-error) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

cypress-fail-on-console-error

Cypress plugin to observe for console errors which causes the test to fail.

Installation

npm install cypress-fail-on-console-error --save-dev

Usage

cypress/support/index.ts

import failOnConsoleError from 'cypress-fail-on-console-error';

failOnConsoleError();

Config (optional)

Parameter Default Description
excludeMessages undefined Exclude console messages from throwing assertionError
includeConsoleTypes [ConsoleType.ERROR] Include console types for observation

const config: Config = {
    excludeMessages: ['foo', '^bar-regex.*$'],
    includeConsoleTypes: [
        ConsoleType.ERROR,
        ConsoleType.WARN,
        ConsoleType.INFO,
    ],
};

failOnConsoleError(config);