cypress-recurse
cypress-recurse copied to clipboard
Hmm, Promise<never> when using an arrow function?
recurse(
() => cy.get('#output').invoke('text'),
(text) => text === 'Surprise!',
TypeScript check complains about Promise<never>
?

Making a full function seems to solve a problem, but why...
function getText() {
return cy.get('#output').invoke('text')
}
recurse(getText, (text) => text === 'Surprise!')

cc @Stumblinbear
Ahh, I see what happened. I was having issues getting JSDoc to be happy by not using TS overloading, but that seems to be causing issues. Let me quick fix that.
Fixed by #78
:tada: This issue has been resolved in version 1.14.1 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
Need to reopen, since still shows the same problem

@Stumblinbear ^^^
Got a code sample to reproduce?
Yup it is the basic-spec in this repo - I had to add ts-ignore in a couple of places. Run lint script after removing the ts-ignore
Sent from my iPhone
On Mar 7, 2022, at 09:08, Trevin Miller @.***> wrote:
Got a code sample to reproduce?
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you modified the open/close state.
I'm not getting any errors, even without the ts-ignores
Re-installed, tried, the same thing :(

Try pulling my repo and see if you get the same thing. What's the return type of whatever value is in the recursive commandsFn
lambda?
same, thing, for some reason it thinks cy.task('randomNumber')
is Promise<never>

Oh, it's through a task. That seems more like an issue with task than the types here. Is there a definition for defining the return type of 'randomNumber'?