From 10a9182bfe27b357460e80089f0539091ab1c16e Mon Sep 17 00:00:00 2001 From: Morgan Roderick Date: Wed, 19 Feb 2020 10:29:36 +0000 Subject: [PATCH] Replace lolex with @sinonjs/fake-timers The package was renamed. There are no changes in compatibility --- lib/sinon/util/fake-timers.js | 10 +++++----- package.json | 2 +- scripts/preversion.sh | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/sinon/util/fake-timers.js b/lib/sinon/util/fake-timers.js index 9c286027f..4f0345380 100644 --- a/lib/sinon/util/fake-timers.js +++ b/lib/sinon/util/fake-timers.js @@ -1,15 +1,15 @@ "use strict"; var extend = require("./core/extend"); -var llx = require("lolex"); +var FakeTimers = require("@sinonjs/fake-timers"); var globalObject = require("@sinonjs/commons").global; function createClock(config, globalCtx) { - var llxCtx = llx; + var FakeTimersCtx = FakeTimers; if (globalCtx !== null && typeof globalCtx === "object") { - llxCtx = llx.withGlobal(globalCtx); + FakeTimersCtx = FakeTimers.withGlobal(globalCtx); } - var clock = llxCtx.install(config); + var clock = FakeTimersCtx.install(config); clock.restore = clock.uninstall; return clock; } @@ -55,7 +55,7 @@ exports.useFakeTimers = function(dateOrConfig) { exports.clock = { create: function(now) { - return llx.createClock(now); + return FakeTimers.createClock(now); } }; diff --git a/package.json b/package.json index 044d04e84..8621bbf70 100644 --- a/package.json +++ b/package.json @@ -57,10 +57,10 @@ }, "dependencies": { "@sinonjs/commons": "^1.7.0", + "@sinonjs/fake-timers": "^6.0.0", "@sinonjs/formatio": "^5.0.0", "@sinonjs/samsam": "^5.0.1", "diff": "^4.0.2", - "lolex": "^5.1.2", "nise": "^4.0.1", "supports-color": "^7.1.0" }, diff --git a/scripts/preversion.sh b/scripts/preversion.sh index b9ca5aad2..678869a8e 100755 --- a/scripts/preversion.sh +++ b/scripts/preversion.sh @@ -1,6 +1,6 @@ #!/bin/bash -for package in $(npm outdated --parseable nise lolex @sinonjs/formatio @sinonjs/samsam) +for package in $(npm outdated --parseable nise @sinonjs/fake-timers @sinonjs/formatio @sinonjs/samsam) do wanted="$(cut -d: -f2 <<< "$package")" current="$(cut -d: -f3 <<< "$package")"