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 <dion@DionK01.local>
This commit is contained in:
Dion de Koning
2026-02-05 20:24:23 +01:00
committed by GitHub
parent 1b3c0e4f65
commit cfc5ed5997
2 changed files with 6 additions and 3 deletions

View File

@@ -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()],
});

View File

@@ -63,5 +63,8 @@ export default defineConfig({
sequence: {
hooks: 'list',
},
env: {
TZ: 'UTC',
},
},
} as UserConfig);