Socket
Socket
Sign inDemoInstall

@jest/fake-timers

Package Overview
Dependencies
Maintainers
6
Versions
117
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jest/fake-timers - npm Package Compare versions

Comparing version 28.1.3 to 29.0.0-alpha.0

10

build/legacyFakeTimers.js

@@ -438,12 +438,4 @@ 'use strict';

_checkFakeTimers() {
var _this$_fakeTimerAPIs;
// @ts-expect-error: condition always returns 'true'
if (
this._global.setTimeout !==
((_this$_fakeTimerAPIs = this._fakeTimerAPIs) === null ||
_this$_fakeTimerAPIs === void 0
? void 0
: _this$_fakeTimerAPIs.setTimeout)
) {
if (this._global.setTimeout !== this._fakeTimerAPIs?.setTimeout) {
this._global.console.warn(

@@ -450,0 +442,0 @@ 'A function to advance timers was called but the timers APIs are not mocked ' +

17

build/modernFakeTimers.js

@@ -165,4 +165,2 @@ 'use strict';

_toSinonFakeTimersConfig(fakeTimersConfig = {}) {
var _fakeTimersConfig$doN, _fakeTimersConfig$now;
fakeTimersConfig = {...this._config.fakeTimers, ...fakeTimersConfig};

@@ -174,16 +172,9 @@ const advanceTimeDelta =

const toFake = new Set(Object.keys(this._fakeTimers.timers));
(_fakeTimersConfig$doN = fakeTimersConfig.doNotFake) === null ||
_fakeTimersConfig$doN === void 0
? void 0
: _fakeTimersConfig$doN.forEach(nameOfFakeableAPI => {
toFake.delete(nameOfFakeableAPI);
});
fakeTimersConfig.doNotFake?.forEach(nameOfFakeableAPI => {
toFake.delete(nameOfFakeableAPI);
});
return {
advanceTimeDelta,
loopLimit: fakeTimersConfig.timerLimit || 100_000,
now:
(_fakeTimersConfig$now = fakeTimersConfig.now) !== null &&
_fakeTimersConfig$now !== void 0
? _fakeTimersConfig$now
: Date.now(),
now: fakeTimersConfig.now ?? Date.now(),
shouldAdvanceTime: Boolean(fakeTimersConfig.advanceTimers),

@@ -190,0 +181,0 @@ shouldClearNativeTimers: true,

{
"name": "@jest/fake-timers",
"version": "28.1.3",
"version": "29.0.0-alpha.0",
"repository": {

@@ -20,15 +20,15 @@ "type": "git",

"dependencies": {
"@jest/types": "^28.1.3",
"@jest/types": "^29.0.0-alpha.0",
"@sinonjs/fake-timers": "^9.1.2",
"@types/node": "*",
"jest-message-util": "^28.1.3",
"jest-mock": "^28.1.3",
"jest-util": "^28.1.3"
"jest-message-util": "^29.0.0-alpha.0",
"jest-mock": "^29.0.0-alpha.0",
"jest-util": "^29.0.0-alpha.0"
},
"devDependencies": {
"@jest/test-utils": "^28.1.3",
"@jest/test-utils": "^29.0.0-alpha.0",
"@types/sinonjs__fake-timers": "^8.1.2"
},
"engines": {
"node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0"
"node": "^14.15.0 || ^16.10.0 || >=18.0.0"
},

@@ -38,3 +38,3 @@ "publishConfig": {

},
"gitHead": "2cce069800dab3fc8ca7c469b32d2e2b2f7e2bb1"
"gitHead": "6862afb00307b52f32eedee977a9b3041355f184"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc