From: Jan Sandbrink Date: Mon, 4 May 2015 13:00:24 +0000 (+0200) Subject: add tests for ISO bubbling X-Git-Tag: 2.10.5~30^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b728ddbad6653e4e48ae8c92a887ea673b1b167e;p=thirdparty%2Fmoment.git add tests for ISO bubbling --- diff --git a/src/test/moment/duration.js b/src/test/moment/duration.js index 5965303a7..b6fb7b33f 100644 --- a/src/test/moment/duration.js +++ b/src/test/moment/duration.js @@ -258,6 +258,7 @@ test('serialization to ISO 8601 duration strings', function (assert) { assert.equal(moment.duration({s: -0.5}).toISOString(), '-PT0.5S', 'one half second ago'); assert.equal(moment.duration({y: -0.5, M: 1}).toISOString(), '-P5M', 'a month after half a year ago'); assert.equal(moment.duration({}).toISOString(), 'P0D', 'zero duration'); + assert.equal(moment.duration({M: 16, d:40, s: 86465}).toISOString(), 'P1Y4M40DT24H1M5S', 'all fields'); }); test('toString acts as toISOString', function (assert) { @@ -267,6 +268,7 @@ test('toString acts as toISOString', function (assert) { assert.equal(moment.duration({s: -0.5}).toString(), '-PT0.5S', 'one half second ago'); assert.equal(moment.duration({y: -0.5, M: 1}).toString(), '-P5M', 'a month after half a year ago'); assert.equal(moment.duration({}).toString(), 'P0D', 'zero duration'); + assert.equal(moment.duration({M: 16, d:40, s: 86465}).toString(), 'P1Y4M40DT24H1M5S', 'all fields'); }); test('toIsoString deprecation', function (assert) {