Skip to content

Commit

Permalink
fix tests timezone
Browse files Browse the repository at this point in the history
  • Loading branch information
Bricks666 committed Aug 26, 2024
1 parent bc3c234 commit 7ba787f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions configs/tests/global-setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const setup = () => {
process.env.TZ = 'UTC';
};
4 changes: 2 additions & 2 deletions src/shared/ui/date-time/__snapshots__/date-time.spec.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
exports[`shared/ui/date-time/date-time > should render time element with formated time 1`] = `
<time
class="MuiTypography-root MuiTypography-body2 css-e784if-MuiTypography-root"
datetime="2024-12-11T21:00:00.000Z"
title="2024-12-11T21:00:00.000Z"
datetime="2024-12-12T00:00:00.000Z"
title="2024-12-12T00:00:00.000Z"
>
12-12-2024
</time>
Expand Down
1 change: 1 addition & 0 deletions vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export default defineConfig({
test: {
environment: 'jsdom',
setupFiles: [path.resolve(__dirname, './configs/tests/setup.ts')],
globalSetup: path.resolve(__dirname, './configs/tests/global-setup.ts'),
include: ['./src/**/*.spec.{ts,tsx}'],
clearMocks: true,
globals: true,
Expand Down

0 comments on commit 7ba787f

Please sign in to comment.