]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
Adding unit tests to verify strict date parsing of ISO-8601 dates.
authorPhil Johnson <phil.johnson789@gmail.com>
Thu, 4 Jun 2015 19:56:01 +0000 (15:56 -0400)
committerIskren Chernev <iskren.chernev@gmail.com>
Mon, 13 Jul 2015 00:14:29 +0000 (17:14 -0700)
src/test/moment/is_valid.js

index 0e66433888ba987d5e4dd5a30deb9382e60b11d9..c070b0beb1537223c0d8c7ecc96bdb71569adaca 100644 (file)
@@ -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');
     }
 });