question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
jeep87ccommented, 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!

0reactions
cypress-bot[bot]commented, May 17, 2019

Released in 3.3.0.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to overwrite incorrect TypeScript type definition installed ...
The typings have errors but are declared in the jimp source directory (jimp.js and jimp.d.ts). I need my local replacement to override the...
Read more >
Template type checking - Angular
When a library's typings are wrong or incomplete (for example, missing null | undefined if the library was not written with strictNullChecks in...
Read more >
Documentation - TypeScript 3.7
When we write code like. ts. let x = foo?.bar.baz();. this is a way of saying that when foo is defined, foo.bar.baz() will...
Read more >
Announcing TypeScript 4.3 - Microsoft Developer Blogs
Let's dive in to what TypeScript 4.3 brings! Separate Write Types on Properties; override and the --noImplicitOverride Flag; Template String ...
Read more >
The unknown Type in TypeScript - Marius Schulz
TypeScript 3.0 introduced a new unknown type which is the type-safe counterpart of the any type.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found