From: Phil Johnson Date: Thu, 4 Jun 2015 19:56:01 +0000 (-0400) Subject: Adding unit tests to verify strict date parsing of ISO-8601 dates. X-Git-Tag: 2.10.5~27^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0a8946f53cc6169728828ed157c110f0606e8e9a;p=thirdparty%2Fmoment.git Adding unit tests to verify strict date parsing of ISO-8601 dates. --- diff --git a/src/test/moment/is_valid.js b/src/test/moment/is_valid.js index 0e6643388..c070b0beb 100644 --- a/src/test/moment/is_valid.js +++ b/src/test/moment/is_valid.js @@ -126,8 +126,10 @@ test('valid string iso 8601 + timezone', function (assert) { ], i; for (i = 0; i < tests.length; i++) { - assert.equal(moment(tests[i]).isValid(), true, tests[i] + ' should be valid'); - assert.equal(moment.utc(tests[i]).isValid(), true, tests[i] + ' should be valid'); + assert.equal(moment(tests[i]).isValid(), true, tests[i] + ' should be valid in normal'); + assert.equal(moment.utc(tests[i]).isValid(), true, tests[i] + ' should be valid in normal'); + assert.equal(moment(tests[i], moment.ISO_8601, true).isValid(), true, tests[i] + ' should be valid in strict'); + assert.equal(moment.utc(tests[i], moment.ISO_8601, true).isValid(), true, tests[i] + ' should be valid in strict'); } });