Qadam Roadmap
проектdocs/Agents/rules/testing-timezone.md

In package.json scripts

Обновлён 1 апр. 2026 г., 12:41 · 0 комментариев


title: Always Run Tests with TZ=UTC impact: MEDIUM impactDescription: Prevents timezone-related test failures tags: testing, timezone, consistency

Паспорт документа

  • Статус документа: living standard
  • Актуально на: 28 марта 2026 года
  • Владелец: backend/platform-команда
  • Пересмотр: при изменении инженерной практики, CI/CD, архитектурных правил или локального workflow
  • Область применения: внутренние rule/reference-card документы для инженерной команды
  • Связанные документы:

Always Run Tests with TZ=UTC

Impact: MEDIUM

Tests must produce consistent results regardless of the developer's local timezone. Set TZ=UTC for all test commands.

# In package.json scripts
"test": "TZ=UTC vitest run",
"test:watch": "TZ=UTC vitest",
"test:e2e": "TZ=UTC jest --config ./test/jest-e2e.json"

In Test Code

// Good — explicit timezone in tests
const date = new Date('2026-03-12T10:00:00Z'); // Always UTC

// Bad — ambiguous timezone
const date = new Date('2026-03-12 10:00:00'); // Depends on local TZ

Uzbekistan is UTC+5. When testing time-dependent features (schedules, availability), always use explicit UTC timestamps and convert in assertions.