]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
#788 add tests for year first array
authorTim Wood <washwithcare@gmail.com>
Mon, 3 Jun 2013 18:39:15 +0000 (11:39 -0700)
committerTim Wood <washwithcare@gmail.com>
Mon, 3 Jun 2013 18:39:15 +0000 (11:39 -0700)
test/moment/create.js

index e48fe6a050755a1bf87121194bcf75017e0d1444..2290fb41df456e77729e91bde06de9c066634c0b 100644 (file)
@@ -248,7 +248,7 @@ exports.create = {
     },
 
     "string with array of formats" : function(test) {
-        test.expect(12);
+        test.expect(14);
 
         test.equal(moment('11-02-1999', ['MM-DD-YYYY', 'DD-MM-YYYY']).format('MM DD YYYY'), '11 02 1999', 'switching month and day');
         test.equal(moment('02-11-1999', ['MM/DD/YYYY', 'YYYY-MM-DD', 'MM-DD-YYYY']).format('MM DD YYYY'), '02 11 1999', 'year last');
@@ -256,6 +256,8 @@ exports.create = {
 
         test.equal(moment('02-11-1999', ['MM/DD/YYYY', 'YYYY-MM-DD']).format('MM DD YYYY'), '02 11 1999', 'year last');
         test.equal(moment('1999-02-11', ['MM/DD/YYYY', 'YYYY-MM-DD']).format('MM DD YYYY'), '02 11 1999', 'year first');
+        test.equal(moment('02-11-1999', ['YYYY-MM-DD', 'MM/DD/YYYY']).format('MM DD YYYY'), '02 11 1999', 'year last');
+        test.equal(moment('1999-02-11', ['YYYY-MM-DD', 'MM/DD/YYYY']).format('MM DD YYYY'), '02 11 1999', 'year first');
 
         test.equal(moment('13-11-1999', ['MM/DD/YYYY', 'DD/MM/YYYY']).format('MM DD YYYY'), '11 13 1999', 'second must be month');
         test.equal(moment('11-13-1999', ['MM/DD/YYYY', 'DD/MM/YYYY']).format('MM DD YYYY'), '11 13 1999', 'first must be month');