Skip to content

Fix time conversion round-trip tests failing in CI #161

@alejandro-runner

Description

@alejandro-runner

Problem

Round-trip conversion tests for unixAndTzidToIso8601() are failing in GitHub CI with a 24-hour (86400000ms) difference, but pass locally.

Failing Tests

  • round-trips correctly with explicit UTC timezone
  • handles edge cases around midnight with explicit UTC

Error

AssertionError: expected 86400000 to be less than 60000

Environment Differences

  • Local: Tests pass (21/21)
  • CI: Tests fail with 24-hour difference
  • CI Environment: Ubuntu, Node.js 20, UTC timezone
  • Local Environment: macOS, Node.js 22, America/Los_Angeles timezone

Investigation Needed

  1. Why is there a 24-hour difference in CI but not locally?
  2. Is Intl.DateTimeFormat with timeZoneName: 'longOffset' producing different results in CI?
  3. Are date components being formatted differently in CI?
  4. Is there a timezone data difference between environments?

Current Implementation

The function uses Intl.DateTimeFormat with timeZoneName: 'longOffset' to get the offset directly, which should be environment-independent, but something is still different in CI.

Related

Part of Issue #150 - Create Time Conversion Utilities

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions