]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
Add more iso tests variations (strict and non-strict ISO_8601)
authorIskren Chernev <iskren.chernev@gmail.com>
Sat, 10 Oct 2015 19:38:56 +0000 (12:38 -0700)
committerIskren Chernev <iskren.chernev@gmail.com>
Mon, 9 Nov 2015 02:27:40 +0000 (18:27 -0800)
src/test/moment/create.js

index ac48dba317a4409da7bf0cfd7139a35396374e5d..425c47ed10451eb249c1b0531b181b4e5884e81d 100644 (file)
@@ -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]);
     }
 });