From d708bcd108f9348fb2adf0549b73afc8fb01b292 Mon Sep 17 00:00:00 2001 From: Alec Gibson <12036746+alecgibson@users.noreply.github.com> Date: Tue, 15 Aug 2023 17:46:05 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9E=96=20Remove=20`lolex`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `sinon` has ships with its own fake timers, so let's just use those. --- package.json | 1 - test/client/snapshot-timestamp-request.js | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/package.json b/package.json index b7c5636af..5cceb829b 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,6 @@ "coveralls": "^3.1.1", "eslint": "^7.32.0", "eslint-config-google": "^0.14.0", - "lolex": "^5.1.2", "mocha": "^10.2.0", "nyc": "^15.1.0", "ot-json0-v2": "https://github.com/ottypes/json0#90a3ae26364c4fa3b19b6df34dad46707a704421", diff --git a/test/client/snapshot-timestamp-request.js b/test/client/snapshot-timestamp-request.js index 2d9850e6f..5ba12ee8d 100644 --- a/test/client/snapshot-timestamp-request.js +++ b/test/client/snapshot-timestamp-request.js @@ -1,6 +1,5 @@ var Backend = require('../../lib/backend'); var expect = require('chai').expect; -var lolex = require('lolex'); var MemoryDb = require('../../lib/db/memory'); var MemoryMilestoneDb = require('../../lib/milestone-db/memory'); var sinon = require('sinon'); @@ -18,7 +17,7 @@ describe('SnapshotTimestampRequest', function() { var ONE_DAY = 1000 * 60 * 60 * 24; beforeEach(function() { - clock = lolex.install({now: day1}); + clock = sinon.useFakeTimers(day1); backend = new Backend(); });