cypress-fail-on-console-error
cypress-fail-on-console-error copied to clipboard
setConfig() are not working for component test runner
When using FailOnConsoleError setConfig() it gives unexpected result.
TestCase: set consoleTypes to 'info' and raise console.error() should pass the test. Given is it fails with console.error()
Example Code: describe('shouldFailOnConsoleError', () => { it('should throw AssertionError on console.error', () => { cy.setConfig({ consoleTypes: ['info'] }).then(() => { cy.then(() => { cy.mount(WithError, 'with-error'); // cy.mount(WithInfo, 'with-info'); }); }); }); // });
class WithError extends HTMLElement { connectedCallback() { console.error('anyErrorMessage'); } }
class WithInfo extends HTMLElement { connectedCallback() { console.info('consoleInfoMessage'); } }