docs: document local timezone mocking in tests runbook
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 5
- Forks
- 7
- Avg merge
- 39m
- Merged PRs (30d)
- 39
Description
🎯 What needs to be done
Add a runbook section in docs/TESTING.md documenting how to use TestClock and time.ts utilities to mock dates, midnight boundaries, and specific IANA timezones in unit tests.
Why this matters
PACT guarantees timezone safety across global timezones (e.g. America/New_York, Asia/Kolkata, Europe/London). Explaining how to test timezone-sensitive code helps contributors write robust unit tests.
📍 Where to work
docs/TESTING.mdtests/temporal-engine.test.ts(Reference existing test patterns)
🧭 Implementation guidance
- Open
docs/TESTING.mdand locate Section 3 ("Test Authoring Patterns"). - Add a sub-section titled "Timezone & Clock Mocking".
- Provide code snippets showing how
utcToLocal,localToUtc, and injected timestamp parameters work in domain tests.
✅ Acceptance criteria
-
docs/TESTING.mdexplains timezone mocking patterns clearly. - Examples reflect actual utilities in
src/lib/time.ts.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in Section 3 of docs/TESTING.md, then read tests/temporal-engine.test.ts and src/lib/time.ts to verify the existing TestClock, time.ts, timezone, and injected-timestamp patterns. Document those patterns with examples for utcToLocal, localToUtc, midnight boundaries, IANA timezones, and domain tests. Done means the runbook is clear and all examples match the actual utilities.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- documentation, testing-qa
- Issue type
- Documentation
- Difficulty
- 1/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 90/100