mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 07:50:31 +00:00
Move the 200ms delay to before the add call
This ensures that a new timestamp is created after the initial call to `addOrUpdateParkingStructure`
This commit is contained in:
@@ -175,10 +175,10 @@ describe.each(repositoryImplementations)('$name', (holder) => {
|
|||||||
{ ...testStructure, spotsAvailable: 60, updatedTime: new Date() },
|
{ ...testStructure, spotsAvailable: 60, updatedTime: new Date() },
|
||||||
];
|
];
|
||||||
|
|
||||||
// Add updates with small delays to ensure different timestamps
|
|
||||||
for (let i = 0; i < updates.length; i++) {
|
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 new Promise((resolve) => setTimeout(resolve, 200));
|
||||||
|
await repository.addOrUpdateParkingStructure(updates[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
const now = Date.now();
|
const now = Date.now();
|
||||||
|
|||||||
Reference in New Issue
Block a user