Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setConfig() are not working for component test runner #319

Open
nils-hoyer opened this issue Jan 6, 2024 · 0 comments
Open

setConfig() are not working for component test runner #319

nils-hoyer opened this issue Jan 6, 2024 · 0 comments

Comments

@nils-hoyer
Copy link
Owner

nils-hoyer commented 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');
}
}

@nils-hoyer 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 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant