From cfc5ed5997a440ab95fb52cbb33c21c24bed9b52 Mon Sep 17 00:00:00 2001 From: Dion de Koning Date: Thu, 5 Feb 2026 20:24:23 +0100 Subject: [PATCH] fix: timezone issue in tests (#25937) * Fixed an issue where time tests fail in some timezones * Revert previous fix and add TZ env variable to fix the issue * Revert other changes and align TZ fix between server and web * Revert package lock file --------- Co-authored-by: Dion de Koning --- server/test/vitest.config.mjs | 6 +++--- web/vite.config.ts | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/server/test/vitest.config.mjs b/server/test/vitest.config.mjs index 6d9ee3a564..79d053d176 100644 --- a/server/test/vitest.config.mjs +++ b/server/test/vitest.config.mjs @@ -2,9 +2,6 @@ import swc from 'unplugin-swc'; import tsconfigPaths from 'vite-tsconfig-paths'; import { defineConfig } from 'vitest/config'; -// Set the timezone to UTC to avoid timezone issues during testing -process.env.TZ = 'UTC'; - export default defineConfig({ test: { root: './', @@ -25,6 +22,9 @@ export default defineConfig({ fallbackCJS: true, }, }, + env: { + TZ: 'UTC', + }, }, plugins: [swc.vite(), tsconfigPaths()], }); diff --git a/web/vite.config.ts b/web/vite.config.ts index 6a2f34cf55..69e1d7152f 100644 --- a/web/vite.config.ts +++ b/web/vite.config.ts @@ -63,5 +63,8 @@ export default defineConfig({ sequence: { hooks: 'list', }, + env: { + TZ: 'UTC', + }, }, } as UserConfig);