-
-
Notifications
You must be signed in to change notification settings - Fork 771
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
Breaking change in 10.0.1: config.target is no longer supported #2352
Comments
I have a problem with [email protected] and typescript which is surely related to this issue. To reproduce, create index.js with the following content: const sinon = require("sinon"); And execute: npm install [email protected]
npm install @types/[email protected]
npm install [email protected]
npx tsc index.js --declaration --allowJs --emitDeclarationOnly The result is: node_modules/@types/sinon/index.d.ts:778:36 - error TS2694: Namespace '"/tmp/testcase/node_modules/@sinonjs/fake-timers/types/fake-timers-src"' has no exported member 'TimerId'.
778 type SinonTimerId = FakeTimers.TimerId;
~~~~~~~
node_modules/@types/sinon/index.d.ts:780:39 - error TS2694: Namespace '"/tmp/testcase/node_modules/@sinonjs/fake-timers/types/fake-timers-src"' has no exported member 'InstalledMethods'.
780 type SinonFakeTimers = FakeTimers.InstalledMethods &
~~~~~~~~~~~~~~~~
node_modules/@types/sinon/index.d.ts:781:20 - error TS2694: Namespace '"/tmp/testcase/node_modules/@sinonjs/fake-timers/types/fake-timers-src"' has no exported member 'NodeClock'.
781 FakeTimers.NodeClock &
~~~~~~~~~
node_modules/@types/sinon/index.d.ts:782:20 - error TS2694: Namespace '"/tmp/testcase/node_modules/@sinonjs/fake-timers/types/fake-timers-src"' has no exported member 'BrowserClock'.
782 FakeTimers.BrowserClock & {
~~~~~~~~~~~~
Found 4 errors. |
@regseb |
Hi thanks for fixing. what's the ETA on this? We'll pin our version, if it's going to take a few days. |
@nicoleczhu pin your version. no one is paid to do this, so it will be when someone does the work to fix and test this manually. that being said, I think this has a high priority, so it will be looked at soon by someone in @sinonjs/sinon-core |
@fatso83 I empathize with the no one is paid to do this argument, as someone who's sunk countless hours into handling CVEs for injection bugs logged against yargs. But just wanted to make sure you knew about this feature on npm:
☝️ this would get folks unblocked who are broken by |
https://github.com/sinonjs/fake-timers appears to have added types which are incompatible with the current implementation in DefinitelyTyped. Refs: sinonjs/sinon#2353 Refs: sinonjs/sinon#2352
* fix: temporarily pin sinon at 10.0.0 until this is fixed: sinonjs/sinon#2352 * chore: let npm rearrange the imports for some devDependencies
Top tip! Thank you @bcoe |
Thank you for the very accurate bug report @kevinoid 👍 Your analysis is correct: the updated version of In the npm registry the Once #2351 is merged and #2353 is resolved, I'll release a new major version detailing the breaking change in the changelog |
@mroderick thank you for getting us unblocked 👏 |
@mroderick are we there? I am not sure what is needed to get #2353 resolved. The NPM fix seemed like it resolved the issue and #2351 prevents it, or ...? |
I just retried @regseb's example on the current Sinon code, and I got 0 errors, so it seems like this should be good ... Releasing Sinon 11. |
As Sinon 11 is out, the breaking change comes with a major version and should be good. Mentioned in the changelog. |
My typescript project is failing to compile with |
@perrin4869 Make sure you update all the dependencies. Do you still have that error if you clean |
@perrin4869 If you still have problems, could you please file a new issue and make some reproducible test case for us? I do not have anything to reproduce. The only bit I have works fine. |
hm... Will try to dig into it later, maybe dependabot did a derp, but looking at the |
@perrin4869 Remember you also need to update your types. Using the example by @regseb:
|
Ah didn't notice |
Describe the bug
With
[email protected]
, ifoptions
containstarget
,sinon.useFakeTimers
throws aTypeError
. This did not occur with[email protected]
.To Reproduce
Create
index.js
with the following content:Run
node index.js
afternpm install [email protected]
and afternpm install [email protected]
. After installing[email protected]
the following error is printed:Expected behavior
No exception would occur.
Additional context
The problem was introduced by f838d78 which bumped
@sinonjs/fake-timers
from^6.0.1
to^7.0.4
which includes sinonjs/fake-timers#318.The text was updated successfully, but these errors were encountered: