Describe the bug
With [email protected], if options contains target, sinon.useFakeTimers throws a TypeError. This did not occur with [email protected].
To Reproduce
Create index.js with the following content:
const sinon = require('sinon');
sinon.useFakeTimers({ target: { Date } });
Run node index.js after npm install [email protected] and after npm install [email protected]. After installing [email protected] the following error is printed:
/path/to/node_modules/@sinonjs/fake-timers/src/fake-timers-src.js:1299
throw new TypeError(
^
TypeError: config.target is no longer supported. Use `withGlobal(target)` instead.
at Object.install (/path/to/node_modules/@sinonjs/fake-timers/src/fake-timers-src.js:1299:19)
at createClock (/path/to/node_modules/sinon/lib/sinon/util/fake-timers.js:12:31)
at exports.useFakeTimers (/path/to/node_modules/sinon/lib/sinon/util/fake-timers.js:54:16)
at Sandbox.useFakeTimers (/path/to/node_modules/sinon/lib/sinon/sandbox.js:396:46)
at Object.<anonymous> (/path/to/index.js:2:7)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
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.
Describe the bug
With
[email protected], ifoptionscontainstarget,sinon.useFakeTimersthrows aTypeError. This did not occur with[email protected].To Reproduce
Create
index.jswith the following content:Run
node index.jsafternpm 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-timersfrom^6.0.1to^7.0.4which includes sinonjs/fake-timers#318.