From 366998d231959c4710d5c2b27c1102a420422e00 Mon Sep 17 00:00:00 2001 From: Roberto Taglioni Date: Thu, 9 May 2024 15:32:07 +0200 Subject: [PATCH] Improvement --- .../purpose-process/test/testDeletePurposeVersion.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/purpose-process/test/testDeletePurposeVersion.ts b/packages/purpose-process/test/testDeletePurposeVersion.ts index b91e8ed35f..293097d39e 100644 --- a/packages/purpose-process/test/testDeletePurposeVersion.ts +++ b/packages/purpose-process/test/testDeletePurposeVersion.ts @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/no-floating-promises */ -import { describe, expect, it, vi } from "vitest"; +import { afterAll, beforeAll, describe, expect, it, vi } from "vitest"; import { getMockPurposeVersion, getMockPurpose, @@ -33,10 +33,14 @@ import { export const testDeletePurposeVersion = (): ReturnType => describe("deletePurposeVersion", () => { - it("should write in event-store for the deletion of a purpose version", async () => { + beforeAll(() => { vi.useFakeTimers(); vi.setSystemTime(new Date()); - + }); + afterAll(() => { + vi.useRealTimers(); + }); + it("should write in event-store for the deletion of a purpose version", async () => { const mockEService = getMockEService(); const mockPurposeVersion1 = getMockPurposeVersion( purposeVersionState.waitingForApproval