Skip to content

Commit

Permalink
Replace lolex with @sinonjs/fake-timers
Browse files Browse the repository at this point in the history
The package was renamed. There are no changes in compatibility
  • Loading branch information
mroderick committed Feb 19, 2020
1 parent 0b30187 commit 10a9182
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions lib/sinon/util/fake-timers.js
Original file line number Diff line number Diff line change
@@ -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;
}
Expand Down Expand Up @@ -55,7 +55,7 @@ exports.useFakeTimers = function(dateOrConfig) {

exports.clock = {
create: function(now) {
return llx.createClock(now);
return FakeTimers.createClock(now);
}
};

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
2 changes: 1 addition & 1 deletion scripts/preversion.sh
Original file line number Diff line number Diff line change
@@ -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")"
Expand Down

0 comments on commit 10a9182

Please sign in to comment.