From a841f8443f8f224f5ef97d99939549efbae7eece Mon Sep 17 00:00:00 2001 From: Iskren Chernev Date: Fri, 24 Jan 2014 00:29:56 -0800 Subject: [PATCH] Workaround safari bug 13 March 2011 is not handled properly in Safari. Detect bug and exit test early. --- test/moment/add_subtract.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/moment/add_subtract.js b/test/moment/add_subtract.js index 2d651b0db..85b4046bf 100644 --- a/test/moment/add_subtract.js +++ b/test/moment/add_subtract.js @@ -223,7 +223,12 @@ exports.add = { }, "add across DST" : function (test) { - test.expect(3); + // Detect Safari bug and bail. Hours on 13th March 2011 are shifted + // with 1 ahead. + if (new Date(2011, 2, 13, 5, 0, 0).getHours() !== 5) { + test.done(); + return; + } var a = moment(new Date(2011, 2, 12, 5, 0, 0)), b = moment(new Date(2011, 2, 12, 5, 0, 0)), -- 2.47.2