From 708dcd61b7f47e91a7be2993fdde25bd4cc93125 Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Mon, 9 Dec 2024 13:45:32 -0500 Subject: [PATCH] Force a consistent non-UTC timezone for tests, so we can validate outputs --- client/src/utils/dates.test.ts | 2 +- client/tests/jest/jest.setup.js | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/client/src/utils/dates.test.ts b/client/src/utils/dates.test.ts index be2ee28c06eb..02583c03258e 100644 --- a/client/src/utils/dates.test.ts +++ b/client/src/utils/dates.test.ts @@ -38,4 +38,4 @@ describe("dates.ts", () => { expect(formatted).toBe("Sunday Oct 1st 8:00:00 2023 GMT-4"); }); }); -}); \ No newline at end of file +}); diff --git a/client/tests/jest/jest.setup.js b/client/tests/jest/jest.setup.js index 505e186fd517..430ed695106b 100644 --- a/client/tests/jest/jest.setup.js +++ b/client/tests/jest/jest.setup.js @@ -12,6 +12,9 @@ Vue.config.devtools = false; and this makes the tag tests work correctly */ global.setImmediate = global.setTimeout; +// Consistent timezone for tests so we can compare dates +process.env.TZ = "America/New_York"; + // Always mock the following imports jest.mock("@/composables/hashedUserId"); jest.mock("@/composables/userLocalStorage");