You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
nils-hoyer
changed the title
Component test fails on wrong console match
getConfig() and setConfig() are not working for component test runner
Jan 6, 2024
nils-hoyer
changed the title
getConfig() and setConfig() are not working for component test runner
setConfig() are not working for component test runner
Jan 6, 2024
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');
}
}
The text was updated successfully, but these errors were encountered: