]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
Test is no longer dependent on the time it's being run and is now statically set...
authorZeb Barnett <spacephlite@gmail.com>
Sun, 1 Nov 2015 06:31:02 +0000 (01:31 -0500)
committerIskren Chernev <iskren.chernev@gmail.com>
Wed, 9 Dec 2015 06:22:17 +0000 (22:22 -0800)
src/test/moment/diff.js

index ea863b1eac2b902137fa926b636b825337644f6b..6eb785b7bd0c4a019950bf88dd17dc6c0708e621 100644 (file)
@@ -40,7 +40,7 @@ test('diff', function (assert) {
     assert.equal(moment(1000).diff(500), 500, '1 second - 0.5 seconds = 500');
     assert.equal(moment(0).diff(1000), -1000, '0 - 1 second = -1000');
     assert.equal(moment(new Date(1000)).diff(1000), 0, '1 second - 1 second = 0');
-    var oneHourDate = new Date(),
+    var oneHourDate = new Date(2015, 5, 21),
     nowDate = new Date(+oneHourDate);
     oneHourDate.setHours(oneHourDate.getHours() + 1);
     assert.equal(moment(oneHourDate).diff(nowDate), 60 * 60 * 1000, '1 hour from now = 3600000');