From a8d15bc85d2b6675f0c7a802a1c7d6f4ca868e14 Mon Sep 17 00:00:00 2001 From: Aric Camarata Date: Wed, 25 Feb 2026 18:34:59 -0500 Subject: [PATCH] fix: chronological order test fails in UTC environments The test called getTimes without an explicit tz, so it fell back to -date.getTimezoneOffset()/60. On the developer machine (EDT = UTC-4) this worked; on CI (Ubuntu, UTC = 0) NY's Maghrib crossed midnight, returning ~0.51h instead of ~24.5h, which sorted before Asr (~21h). Add tz=-4 explicitly. All section-8 geographic tests already do this; the chronological test was the only one missing it. --- test.mjs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test.mjs b/test.mjs index 5465718..2b58e35 100644 --- a/test.mjs +++ b/test.mjs @@ -309,7 +309,9 @@ test('getTimes returns all required fields', () => { }); test('getTimes chronological order', () => { - const t = getTimes(new Date('2024-06-21'), 40.7, -74.0); + // Use explicit tz=-4 (EDT) so CI (UTC) and local machines give identical results. + // Without it, NY's Maghrib falls past UTC midnight, wrapping to ~0.5h < Asr(~21h). + const t = getTimes(new Date('2024-06-21'), 40.7, -74.0, -4); // Fajr < Sunrise < Noon < Dhuhr ≈ Noon < Asr < Maghrib < Isha assert(t.Fajr < t.Sunrise, `Fajr(${t.Fajr}) < Sunrise(${t.Sunrise})`); assert(t.Sunrise < t.Noon, `Sunrise(${t.Sunrise}) < Noon(${t.Noon})`);