From: Iskren Chernev Date: Sat, 9 Jan 2016 12:54:38 +0000 (+0200) Subject: Fix IE8 test bug X-Git-Tag: 2.11.1~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=398c67fa8173defe7c987331c338cefd91fbdaf5;p=thirdparty%2Fmoment.git Fix IE8 test bug --- diff --git a/src/test/moment/now.js b/src/test/moment/now.js index f10b34863..eada0c0cd 100644 --- a/src/test/moment/now.js +++ b/src/test/moment/now.js @@ -16,10 +16,10 @@ test('now - Date mocked', function (assert) { // We need to test mocking the global Date object, so disable 'Read Only' jshint check /* jshint -W020 */ var RealDate = Date, - customTimeStr = '2015-01-01T01:30:00.000Z'; + customTimeMs = moment('2015-01-01T01:30:00.000Z').valueOf(); function MockDate() { - return new RealDate(customTimeStr); + return new RealDate(customTimeMs); } MockDate.now = function () { @@ -31,7 +31,7 @@ test('now - Date mocked', function (assert) { Date = MockDate; try { - assert.ok(moment().toISOString() === customTimeStr, 'moment now() time should use the global Date object'); + assert.equal(moment().valueOf(), customTimeMs, 'moment now() time should use the global Date object'); } finally { Date = RealDate; }