Use fake timers on the HLC tests

This commit is contained in:
Alexis Métaireau 2024-10-22 13:16:00 +02:00
parent 8eae7990dd
commit 45f1221d00

View file

@ -79,6 +79,8 @@ describe('HybridLogicalClock', () => {
it('should increment nn when local and remote times are equal', () => {
const now = Date.now()
// mock the clock to be the same time
sinon.useFakeTimers(now)
clock = new HybridLogicalClock(now, 5, 'local')
const result = clock.receive(`${now}:7:remote`)
expect(result.walltime).to.be.at.least(now)