From 88cc8a19eef23af0ace19b1fab3014d70cc44ba5 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Tue, 31 Oct 2023 11:19:53 +0000 Subject: [PATCH] Resetting timekeeper and resetting pro back to normal. --- packages/backend-core/tests/core/utilities/mocks/date.ts | 4 ---- packages/pro | 2 +- packages/server/src/api/routes/tests/backup.spec.ts | 1 + packages/server/src/tests/utilities/api/backup.ts | 4 ---- 4 files changed, 2 insertions(+), 9 deletions(-) diff --git a/packages/backend-core/tests/core/utilities/mocks/date.ts b/packages/backend-core/tests/core/utilities/mocks/date.ts index 9f33058d29..1e6d105d93 100644 --- a/packages/backend-core/tests/core/utilities/mocks/date.ts +++ b/packages/backend-core/tests/core/utilities/mocks/date.ts @@ -1,7 +1,3 @@ export const MOCK_DATE = new Date("2020-01-01T00:00:00.000Z") -export const MOCK_DATE_PLUS = (ms: number) => { - return new Date(Date.now() + ms) -} - export const MOCK_DATE_TIMESTAMP = 1577836800000 diff --git a/packages/pro b/packages/pro index 132b080643..3820c0c93a 160000 --- a/packages/pro +++ b/packages/pro @@ -1 +1 @@ -Subproject commit 132b080643f0b1ef1488bb8362d1c41ea0bd263f +Subproject commit 3820c0c93a3e448e10a60a9feb5396844b537ca8 diff --git a/packages/server/src/api/routes/tests/backup.spec.ts b/packages/server/src/api/routes/tests/backup.spec.ts index 0c62b32155..d12b5e1507 100644 --- a/packages/server/src/api/routes/tests/backup.spec.ts +++ b/packages/server/src/api/routes/tests/backup.spec.ts @@ -14,6 +14,7 @@ describe("/backups", () => { afterAll(setup.afterAll) beforeEach(async () => { + tk.reset() await config.init() }) diff --git a/packages/server/src/tests/utilities/api/backup.ts b/packages/server/src/tests/utilities/api/backup.ts index 4cee19fdc6..f9cbc7086e 100644 --- a/packages/server/src/tests/utilities/api/backup.ts +++ b/packages/server/src/tests/utilities/api/backup.ts @@ -4,8 +4,6 @@ import { } from "@budibase/types" import TestConfiguration from "../TestConfiguration" import { TestAPI } from "./base" -import tk from "timekeeper" -import { mocks } from "@budibase/backend-core/tests" export class BackupAPI extends TestAPI { constructor(config: TestConfiguration) { @@ -25,7 +23,6 @@ export class BackupAPI extends TestAPI { } createBackup = async (appId: string) => { - tk.freeze(mocks.date.MOCK_DATE_PLUS(1)) const result = await this.request .post(`/api/apps/${appId}/backups`) .set(this.config.defaultHeaders()) @@ -38,7 +35,6 @@ export class BackupAPI extends TestAPI { appId: string, backupId: string ): Promise => { - tk.freeze(mocks.date.MOCK_DATE_PLUS(1)) const result = await this.request .post(`/api/apps/${appId}/backups/${backupId}/import`) .set(this.config.defaultHeaders())