From 0a8946f53cc6169728828ed157c110f0606e8e9a Mon Sep 17 00:00:00 2001 From: Phil Johnson Date: Thu, 4 Jun 2015 15:56:01 -0400 Subject: [PATCH] Adding unit tests to verify strict date parsing of ISO-8601 dates. --- src/test/moment/is_valid.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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'); } }); -- 2.47.2