From 74269dbb272408fa7413568d2fb2b93eaf2e069b Mon Sep 17 00:00:00 2001 From: adrinr Date: Wed, 25 Jan 2023 11:51:08 +0000 Subject: [PATCH] Fix timespan issues --- packages/server/src/migrations/tests/index.spec.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/server/src/migrations/tests/index.spec.ts b/packages/server/src/migrations/tests/index.spec.ts index cf283cf518..4540d8f61f 100644 --- a/packages/server/src/migrations/tests/index.spec.ts +++ b/packages/server/src/migrations/tests/index.spec.ts @@ -10,8 +10,9 @@ import * as structures from "../../tests/utilities/structures" import { MIGRATIONS } from "../" import * as helpers from "./helpers" -const { mocks } = require("@budibase/backend-core/tests") -const timestamp = mocks.date.MOCK_DATE.toISOString() +import tk from "timekeeper" +const timestamp = new Date().toISOString() +tk.freeze(timestamp) const clearMigrations = async () => { const dbs = [context.getDevAppDB(), context.getProdAppDB()] @@ -24,6 +25,10 @@ const clearMigrations = async () => { jest.setTimeout(10000) +afterAll(() => { + tk.reset() +}) + describe("migrations", () => { const config = new TestConfig()