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

[Version 7.1.0] Typescript compilation error #387

Closed
lagonnebula opened this issue Jun 2, 2021 · 2 comments
Closed

[Version 7.1.0] Typescript compilation error #387

lagonnebula opened this issue Jun 2, 2021 · 2 comments

Comments

@lagonnebula
Copy link

Hello,

  • FakeTimers version : 7.1.0
  • Environment : Windows, node:erbium-alpine
  • Other libraries you are using:
    • Typescript 3.9.9
    • @sinonjs/common@1.7.0

What did you expect to happen?
To be able to compile with tsc
What actually happens
When i try to compile the project with fake-timers, i got a compilation error :

node_modules/@sinonjs/fake-timers/types/fake-timers-src.d.ts:11:28 - error TS2304: Cannot find name 'queueMicrotask'.
       queueMicrotask: typeof queueMicrotask;
@fatso83
Copy link
Contributor

fatso83 commented Jun 3, 2021

Hi, this is correct, as this project has no such API.

Feel free to submit a feature request for this: spec.

P.S. You will have a much higher chance of seeing that feature request filled if you just do it yourself :)

@fatso83 fatso83 closed this as completed Jun 3, 2021
@fatso83
Copy link
Contributor

fatso83 commented Jun 9, 2021

Hi, I never got a reply to this, but it turns out I was wrong. I just searched the code and found it present - just undocumented (only in JSDoc). See for instance discussion in #233.

The problem is somehow related to the typescript definitions we generated, so you might have better luck installing sinonjs/fake-timers@6 and using the DT @types. We just decided to drop them and leave this to DT the community again for v8 ...

So there is two problems here:

  1. When the feature was added, no docs were added.
  2. The definitions are missing.

The DT types have exposed them in their types: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/sinonjs__fake-timers/index.d.ts#L281

Given that we will not be fixing our own types, I will keep this closed, but open a new feature for improved docs.

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

No branches or pull requests

2 participants