cypress-fail-on-console-error
cypress-fail-on-console-error copied to clipboard
Does not property listen to log events in component runner
Inside of https://github.com/nils-hoyer/cypress-fail-on-console-error/blob/main/src/index.ts#L16, cypress-fail-on-console-error
is listening to window:before:load
events, which do not get called in component mode.
Repro: Add the following to support.ts in a component runner:
import failOnConsoleError rom "cypress-fail-on-console-error"
failOnConsoleError();
Create this test:
it('should fail', () => {
console.error('fail');
})
Expected: test fail Actual: test succeeds
Hi @davidturissini, thanks for reporting that issue. Afaik the cypress component runner was in Alpha state in cypress version < 10 and just hit Beta state starting from version 10. I would like to wait until a release version exists before diving into that feature request but feel free to provide a PR or fork the repo.
Hello @nils-hoyer, appreciate your work on this plugin. I just tried to use it for a component test that was passing even when there was a console errror, but found the plugin not working and then found this issue.
Cypress component testing is out of beta https://www.cypress.io/blog/2022/11/08/announcing-cypress-11/, any chance you could look into this issue?
Linked PR: https://github.com/nils-hoyer/cypress-fail-on-console-error/pull/219
The PR is merged and support for component testing mode is released with version 5.0.0.
Thanks to @jimmux!
Thank you very much, I can confirm the cypress component tests now fail on console error with v5.0.0.