diff --git a/client/src/utils/dates.test.ts b/client/src/utils/dates.test.ts index 02583c03258e..2792bea0efec 100644 --- a/client/src/utils/dates.test.ts +++ b/client/src/utils/dates.test.ts @@ -1,6 +1,14 @@ import { formatGalaxyPrettyDateString, galaxyTimeToDate, localizeUTCPretty } from "./dates"; describe("dates.ts", () => { + beforeEach(() => { + process.env.TZ = "America/New_York"; + }); + + afterEach(() => { + delete process.env.TZ; + }); + describe("galaxyTimeToDate", () => { it("should convert valid galaxyTime string to Date object", () => { const galaxyTime = "2023-10-01T12:00:00"; diff --git a/client/tests/jest/jest.setup.js b/client/tests/jest/jest.setup.js index eb1f67ae1833..505e186fd517 100644 --- a/client/tests/jest/jest.setup.js +++ b/client/tests/jest/jest.setup.js @@ -12,9 +12,6 @@ Vue.config.devtools = false; and this makes the tag tests work correctly */ global.setImmediate = global.setTimeout; -// Consistent timezone for tests so we can compare date strings -process.env.TZ = "America/New_York"; - // Always mock the following imports jest.mock("@/composables/hashedUserId"); jest.mock("@/composables/userLocalStorage");