Skip to content

Commit

Permalink
front: set timezone for test
Browse files Browse the repository at this point in the history
Tests are failing locally because I'm not in the UTC timezone.
So tests are plateform dependent, which is bad.
This commit sets the timezone when runnning vitest.
  • Loading branch information
sim51 committed Jul 5, 2024
1 parent c3d986c commit b05d26f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions front/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export default defineConfig(({ mode }) => {
},
test: {
globals: true,
globalSetup: './vitest.global-setup.ts',
include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
environment: 'happy-dom',
coverage: {
Expand Down
3 changes: 3 additions & 0 deletions front/vitest.global-setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const setup = () => {
process.env.TZ = 'UTC';
};

0 comments on commit b05d26f

Please sign in to comment.