Open adamalston opened 4 months ago
Agreed. As a result it makes it really difficult to use the hasEventListeners function with a type object provided.
The README shows that it's possible to use an object with just the type
property set: https://github.com/bahmutov/cypress-cdp/blob/main/README.md?plain=1#L78
For now, this is my workaround:
cy.hasEventListeners('form', {
type: 'submit',
// @ts-ignore https://github.com/bahmutov/cypress-cdp/issues/99
log: false,
});
Since merging this PR, log
has been made optional which partially resolves this issue.
Agreed @MattWeinstein.
Per the code,
log
can be set to a boolean value in theCDP
command:https://github.com/bahmutov/cypress-cdp/blob/3cbd2061cadd2d2764f999d3e238fb1c21c25e0f/src/index.js#L21
However,
LogConfig
is not a boolean type:https://github.com/bahmutov/cypress-cdp/blob/3cbd2061cadd2d2764f999d3e238fb1c21c25e0f/src/index.d.ts#L28
Cypress
LogConfig
type:https://github.com/cypress-io/cypress/blob/1aad7ba7d1b28d2ea920cdc65a54af74ad470643/cli/types/cypress.d.ts#L6447-#L6466