fix(test): enforce UTC timezone in all test configurations#126
Merged
janhesters merged 1 commit intojanhesters:mainfrom Feb 11, 2026
Merged
fix(test): enforce UTC timezone in all test configurations#126janhesters merged 1 commit intojanhesters:mainfrom
janhesters merged 1 commit intojanhesters:mainfrom
Conversation
fcff747 to
39040fe
Compare
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>
39040fe to
3d17623
Compare
janhesters
approved these changes
Feb 11, 2026
Owner
janhesters
left a comment
There was a problem hiding this comment.
Amazing, thank you for this PR.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
env: { TZ: "UTC" }in all three vitest project configs (unit, integration, happy-dom)timezoneId: "UTC"andTZ: "UTC"in Playwright config (browser + webServer)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, buttoLocaleDateStringin test assertions still used the local timezone)Closes #125
Test plan
TZ=UTC+5 npx vitest runpasses (previously 5 failures inbilling-page.test.tsx)npx vitest runstill passes with default timezonenpx playwright test— billing e2e date assertions pass regardless of local timezone🤖 Generated with Claude Code