From: Iskren Chernev Date: Sat, 10 Oct 2015 19:38:56 +0000 (-0700) Subject: Add more iso tests variations (strict and non-strict ISO_8601) X-Git-Tag: 2.11.0~69^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ed6436d481806e5eda3cc8f40131c5ef21322398;p=thirdparty%2Fmoment.git Add more iso tests variations (strict and non-strict ISO_8601) --- diff --git a/src/test/moment/create.js b/src/test/moment/create.js index ac48dba31..425c47ed1 100644 --- a/src/test/moment/create.js +++ b/src/test/moment/create.js @@ -578,7 +578,12 @@ test('parsing iso', function (assert) { ['2011281 180420,111' + tz2, '2011-10-08T18:04:20.111' + tz] ], i; for (i = 0; i < formats.length; i++) { - assert.equal(moment(formats[i][0]).format('YYYY-MM-DDTHH:mm:ss.SSSZ'), formats[i][1], 'moment should be able to parse ISO ' + formats[i][0]); + assert.equal(moment(formats[i][0]).format('YYYY-MM-DDTHH:mm:ss.SSSZ'), + formats[i][1], 'moment should be able to parse ISO ' + formats[i][0]); + assert.equal(moment(formats[i][0], moment.ISO_8601).format('YYYY-MM-DDTHH:mm:ss.SSSZ'), + formats[i][1], 'moment should be able to parse specified ISO ' + formats[i][0]); + assert.equal(moment(formats[i][0], moment.ISO_8601, true).format('YYYY-MM-DDTHH:mm:ss.SSSZ'), + formats[i][1], 'moment should be able to parse specified strict ISO ' + formats[i][0]); } });