TheVicky1 / TheVicky1/Pact_OS

docs: document local timezone mocking in tests runbook

Open Beginner friendly
#24 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area:documentation beginner friendly community contributions-welcome difficulty:beginner enhancement good first issue help wanted time:15-30m type:docs up-for-grabs
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.md
  • tests/temporal-engine.test.ts (Reference existing test patterns)

🧭 Implementation guidance

  1. Open docs/TESTING.md and locate Section 3 ("Test Authoring Patterns").
  2. Add a sub-section titled "Timezone & Clock Mocking".
  3. Provide code snippets showing how utcToLocal, localToUtc, and injected timestamp parameters work in domain tests.

✅ Acceptance criteria

  • docs/TESTING.md explains timezone mocking patterns clearly.
  • Examples reflect actual utilities in src/lib/time.ts.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.