The method Cypress.dom.isDetached() type errors in Typescript projects.
The method Cypress.dom.isDetached() does not type error in Typescript projects.
describe('Demonstrates bug', function() {
beforeEach(() => {
cy.setup();
});
it('demonstrates Typescript error'), function() {
cy.get('button').then(($el) => {
Cypress.dom.isDetached($el)
});
});
});
Property 'isDetached' does not exist on type '{ isHidden(element: HTMLElement | JQuery<HTMLElement>): boolean; }'
Cypress 3.2.0
Typescript 3.4.5
Chrome 74.0.3729.169
macOS 10.14.5
@jennifer-shehane Do you mind if I pick this up? Also should we add all of the dom functions to the declaration file? It looks like there are a good deal more in dom/index.js that could be added.
@kylerob Go for it.
@jennifer-shehane or @kylerob any progress on this? I have
"cypress": "^4.0.2",
"@types/node": "^10.12.18",
"typescript": "~3.7.2",
node -v 12.16.1
and I am still seeing this issue
The code for this is done in cypress-io/cypress#5298, but has yet to be released.
We'll update this issue and reference the changelog when it's released.
Released in 4.2.0.
This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v4.2.0, please open a new issue.
Most helpful comment
@jennifer-shehane Do you mind if I pick this up? Also should we add all of the dom functions to the declaration file? It looks like there are a good deal more in dom/index.js that could be added.