Description: Only consider 4 decimal points when comparing UTC offsets, to
    avoid failing on rounding differences.
Forwarded: https://github.com/moment/moment/issues/6203
Author: Martina Ferrari <tina@debian.org>
Updated: Thu, 25 Jan 2024 07:13:44 +0000

--- a/tests/helpers/helpers.js
+++ b/tests/helpers/helpers.js
@@ -14,6 +14,11 @@
 	}
 }
 
+function nRound(num, digits) {
+	var mult = 10 ** digits;
+	return Math.round((num + Number.EPSILON) * digits) / digits;
+}
+
 /**
  * Runs tests for a specific year
  */
@@ -31,7 +36,7 @@
 		offset = expected[i][3];
 		m      = moment(date).tz(name);
 		test.equal(m.format("HH:mm:ss"), time, date + ' should be ' + time + ' ' + abbr);
-		test.equal(getUTCOffset(m), -offset, date + ' should be ' + offset + ' minutes offset in ' + abbr);
+		test.equal(nRound(getUTCOffset(m), 4), nRound(-offset, 4), date + ' should be ' + offset + ' minutes offset in ' + abbr);
 		test.equal(m.zoneAbbr(), abbr, date + ' should be ' + abbr);
 	}
 
