]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
Fix IE8 test bug
authorIskren Chernev <iskren.chernev@gmail.com>
Sat, 9 Jan 2016 12:54:38 +0000 (14:54 +0200)
committerIskren Chernev <iskren.chernev@gmail.com>
Sat, 9 Jan 2016 12:54:38 +0000 (14:54 +0200)
src/test/moment/now.js

index f10b34863797d87e644735a6ee6492c71829e8fc..eada0c0cdddf5038f0030fd2cc9a770cae3fd48c 100644 (file)
@@ -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;
     }