I'm currently utilizing Cypress 10.
I came across the following code snippet:
Cypress.Commands.add(
'byTestId',
// Taking the signature from cy.get
<E extends Node = HTMLElement>(
id: string,
options?: Partial<
Cypress.Loggable & Cypress.Timeoutable & Cypress.Withinable & Cypress.Shadow
>,
): Cypress.Chainable<JQuery<E>> =
cy.get(`[data-testid="${id}"]`, options),
);
Can you explain what E extends Node = HTMLElement
means precisely? And is it possible to use E extends HTMLElement
instead?
Is there any distinction between these two?