From: Tim Wood Date: Fri, 2 Mar 2012 00:19:41 +0000 (+0000) Subject: Failing timezone unit tests #188 X-Git-Tag: 1.5.0~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2122ca5e462d13153bcacf2926b00ad0f0036b0f;p=thirdparty%2Fmoment.git Failing timezone unit tests #188 --- diff --git a/test/moment/format.js b/test/moment/format.js index 13a6acf6e..97ecf01d9 100644 --- a/test/moment/format.js +++ b/test/moment/format.js @@ -78,7 +78,11 @@ exports.format = { if (moment().zone() == 0) { test.ok(moment().format('ZZ').indexOf('+') > -1, 'When the zone() offset is equal to 0, the ISO offset should be positive zero'); } - test.ok(moment().zone() % 30 === 0, 'moment.fn.zone should be a multiple of 30 (was ' + moment().zone() + ')'); + if (moment().zone() === 0) { + test.equal(moment().zone(), 0, 'moment.fn.zone should be a multiple of 30 (was ' + moment().zone() + ')'); + } else { + test.equal(moment().zone() % 30, 0, 'moment.fn.zone should be a multiple of 30 (was ' + moment().zone() + ')'); + } test.equal(moment().zone(), new Date().getTimezoneOffset(), 'zone should equal getTimezoneOffset'); test.done(); },