From 7c359dd775aa246049d09758539b54de1276493b Mon Sep 17 00:00:00 2001 From: Brendan Chen Date: Thu, 3 Jul 2025 15:40:14 -0400 Subject: [PATCH] Move the 200ms delay to before the add call This ensures that a new timestamp is created after the initial call to `addOrUpdateParkingStructure` --- test/repositories/ParkingRepositorySharedTests.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/repositories/ParkingRepositorySharedTests.test.ts b/test/repositories/ParkingRepositorySharedTests.test.ts index 21d9f41..d243b4e 100644 --- a/test/repositories/ParkingRepositorySharedTests.test.ts +++ b/test/repositories/ParkingRepositorySharedTests.test.ts @@ -175,10 +175,10 @@ describe.each(repositoryImplementations)('$name', (holder) => { { ...testStructure, spotsAvailable: 60, updatedTime: new Date() }, ]; - // Add updates with small delays to ensure different timestamps for (let i = 0; i < updates.length; i++) { - await repository.addOrUpdateParkingStructure(updates[i]); + // Ensure that different timestamps are created, even after adding the first test structure await new Promise((resolve) => setTimeout(resolve, 200)); + await repository.addOrUpdateParkingStructure(updates[i]); } const now = Date.now();