I'm having some issues with TypeScript and .then always yielding JQuery
. I'm sure there's something obvious I'm missing. So in my test I have some code that calls a function. Inside that function I wrap the object I want to return and give it an alias. So after I call the function in the test, I do a cy.get for the alias, and a .then so I can use the object being returned. Something like this:
getObject(someVar)
cy.get('@alias').then((object) => {
//some code using the object here
}
But the problem is, when using TypeScript, I can't treat
object
like an object because it is always JQuery
. Help?