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.

Type Defintions: Clock returned from install is missing uninstall property/function

See original GitHub issue

FakeTimers version : 7.0.2 Environment : Node.js Example URL : https://codesandbox.io/s/sharp-fast-7zwis?file=/src/index.ts Other libraries you are using: TypeScript (4.1.3)

What did you expect to happen?

When storing the return value of install in a variable, the uninstall function helps uninstalling the fake clock again from the environment.

import FakeTimers from "@sinonjs/fake-timers";

const clock = FakeTimers.install();

clock.uninstall();

Note: I’m currently limited in time, otherwise I would submit a PR which adds the types from DefinitelyTyped as an initial (tested and working) version for the types.

What actually happens

When using TypeScript, the return value of install does not include the uninstall property.

How to reproduce

You can check an example here: https://codesandbox.io/s/sharp-fast-7zwis?file=/src/index.ts

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:5
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

4reactions
mroderickcommented, Feb 1, 2021

Is there anything that triggered this move away from making TypeScript users use the DefinitelyTyped types?

We can make up to date type definitions available to the TS community and save effort.

Perhaps we jumped the gun and released the files too soon. I’m hoping that the TS/DT community will see this in a kind light, and help bring us up to parity with the DT types by contributing to the documenation effort

For those that have gotten bitten by the immature .d.ts files: there’s documentation on how to use the DT types in your project

3reactions
mantonicommented, Feb 8, 2021

@bodinsamuel Yes, we’re strict on this. It’s not about effort or file size.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fix problems that block programs from being installed or ...
The Program Install and Uninstall troubleshooter helps you automatically repair issues when you're blocked from installing or removing programs.
Read more >
Troubleshoot Tableau Server Install and Upgrade
Many Tableau Server issues can be addressed with some basic steps: Make sure there is enough disk space on each computer running Tableau...
Read more >
Java project in Eclipse: The type java.lang.Object cannot be ...
Close the project and reopen it. Clean the project (It will rebuild the buildpath hence reconfiguring with the JDK libraries). OR. Delete and...
Read more >
Symantec Endpoint Protection - TechDocs
package is missing on the Linux client, the forensic information is collected for all other types of events except for network events. Incorrect ......
Read more >
PackageManager - Android Developers
Code indicating that this package was installed as part of device setup. ... Returns the property defined in the given package's <appliction> tag....
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