From: Zeb Barnett Date: Sun, 1 Nov 2015 06:31:02 +0000 (-0500) Subject: Test is no longer dependent on the time it's being run and is now statically set... X-Git-Tag: 2.11.0~27^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=df140243da32603cffb8a1cdabed0ed4c863e753;p=thirdparty%2Fmoment.git Test is no longer dependent on the time it's being run and is now statically set to the Summer Solstice of 2015 which should make it immune to DST-related inconsistencies. --- diff --git a/src/test/moment/diff.js b/src/test/moment/diff.js index ea863b1ea..6eb785b7b 100644 --- a/src/test/moment/diff.js +++ b/src/test/moment/diff.js @@ -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');