Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TS type definition has missing override type of "'Date'" #4090

Closed
eaustin opened this issue May 1, 2019 · 5 comments · Fixed by #4106
Closed

TS type definition has missing override type of "'Date'" #4090

eaustin opened this issue May 1, 2019 · 5 comments · Fixed by #4106
Assignees
Labels

Comments

@eaustin
Copy link

eaustin commented May 1, 2019

Current behavior:

const now = new Date(2019, 3, 2).getTime();
cy.clock(now, ['Date']);  //IDE complains that only 'setTimeout', 'clearTimeout', 'setInterval', 'clearInterval' are available

https://docs.cypress.io/api/commands/clock.html#Now

  • documentation demonstrates that this is a valid use case

Desired behavior:

const now = new Date(2019, 3, 2).getTime();
cy.clock(now, ['Date']); 

Should not generate error/warning message in IDE

Versions

Cypress 3.2.0

@cypress-bot cypress-bot bot added the stage: ready for work The issue is reproducible and in scope label May 2, 2019
@flotwig flotwig self-assigned this May 2, 2019
@cypress-bot cypress-bot bot added stage: work in progress stage: needs review The PR code is done & tested, needs review and removed stage: ready for work The issue is reproducible and in scope stage: work in progress labels May 2, 2019
@cypress-bot cypress-bot bot added stage: pending release and removed stage: needs review The PR code is done & tested, needs review labels May 3, 2019
@cypress-bot
Copy link
Contributor

cypress-bot bot commented May 3, 2019

The code for this is done in cypress-io/cypress#4106, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@jeep87c
Copy link

jeep87c commented May 15, 2019

Do you have an ETA on when this will be released? It is currently preventing us coding clock sensible based tests with cypress in a VueJs app as VueJs heavily relies on intervals.

And unfortunalety we were unable to find a way to do npm i the specific commit including this fix. If you know how, please let us now since this is blocking our team.

Thanks

@flotwig
Copy link
Contributor

flotwig commented May 15, 2019

@jeep87c You should be able to use // @ts-ignore before the line you're using cy.clock() on to suppress the warning in the meantime.

It will be fixed with 3.3.0, which will be out soon.

@jeep87c
Copy link

jeep87c commented May 15, 2019

Gosh I'm feeling dumb... I would swear I tried that (and also many more things...) before posting here but hey it works!

Thanks for your quick reply!

@cypress-bot
Copy link
Contributor

cypress-bot bot commented May 17, 2019

Released in 3.3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants