]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
failing test for #615
authorTim Wood <washwithcare@gmail.com>
Mon, 11 Feb 2013 20:13:10 +0000 (12:13 -0800)
committerTim Wood <washwithcare@gmail.com>
Mon, 11 Feb 2013 20:13:10 +0000 (12:13 -0800)
test/moment/create.js

index 559daa98b2105c235f1129ad91065cb3d6ed758a..09805238ff77ebee2f682f05b2f53dc890994ed7 100644 (file)
@@ -22,6 +22,14 @@ exports.create = {
         test.done();
     },
 
+    "multi format array copying": function(test) {
+        var importantArray = ['MM/DD/YYYY', 'YYYY-MM-DD', 'MM-DD-YYYY'];
+        test.expect(1);
+        moment('1999-02-13', importantArray);
+        test.deepEqual(importantArray, ['MM/DD/YYYY', 'YYYY-MM-DD', 'MM-DD-YYYY'], "initializer should not mutate the original array");
+        test.done();
+    },
+
     "number" : function(test) {
         test.expect(3);
         test.ok(moment(1000).toDate() instanceof Date, "1000");