Skip to content

fix(test): enforce UTC timezone in all test configurations#126

Merged
janhesters merged 1 commit intojanhesters:mainfrom
iulspop:fix/timezone-dependent-tests
Feb 11, 2026
Merged

fix(test): enforce UTC timezone in all test configurations#126
janhesters merged 1 commit intojanhesters:mainfrom
iulspop:fix/timezone-dependent-tests

Conversation

@iulspop
Copy link
Contributor

@iulspop iulspop commented Feb 9, 2026

Summary

  • Set env: { TZ: "UTC" } in all three vitest project configs (unit, integration, happy-dom)
  • Set timezoneId: "UTC" and TZ: "UTC" in Playwright config (browser + webServer)
  • Set process.env.TZ = "UTC" in the Playwright config module so the test runner process itself uses UTC (previously only the browser and dev server were pinned to UTC, but toLocaleDateString in test assertions still used the local timezone)
  • Fixes 5 billing page tests that fail in non-UTC timezones

Closes #125

Test plan

  • TZ=UTC+5 npx vitest run passes (previously 5 failures in billing-page.test.tsx)
  • npx vitest run still passes with default timezone
  • npx playwright test — billing e2e date assertions pass regardless of local timezone

🤖 Generated with Claude Code

@iulspop iulspop force-pushed the fix/timezone-dependent-tests branch from fcff747 to 39040fe Compare February 9, 2026 21:26
Tests that assert formatted date strings fail in non-UTC timezones
because Intl.DateTimeFormat and date-fns format dates in the local
timezone. Set TZ=UTC in all three vitest projects and in the Playwright
config (both browser timezoneId and webServer env) so results are
deterministic regardless of the developer's local timezone.

Closes janhesters#125

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@iulspop iulspop force-pushed the fix/timezone-dependent-tests branch from 39040fe to 3d17623 Compare February 10, 2026 14:34
Copy link
Owner

@janhesters janhesters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing, thank you for this PR.

@janhesters janhesters merged commit 32eece1 into janhesters:main Feb 11, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: tests fail in non-UTC timezones due to missing TZ configuration

2 participants