]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
Add test for momentProperties and cloning 1808/head
authorIskren Chernev <iskren.chernev@gmail.com>
Wed, 30 Jul 2014 05:25:04 +0000 (22:25 -0700)
committerIskren Chernev <iskren.chernev@gmail.com>
Wed, 30 Jul 2014 05:30:42 +0000 (22:30 -0700)
test/moment/create.js

index a10a8a357d67d6c33ab53268d6decc55cc16966e..7f81f0c68d692f97118123cfe248a03de4f5eea0 100644 (file)
@@ -128,6 +128,18 @@ exports.create = {
         test.done();
     },
 
+    "cloning respects moment.momentProperties" : function (test) {
+        var m = moment();
+
+        test.equal(m.clone()._special, undefined, "cloning ignores extra properties");
+        m._special = "bacon";
+        moment.momentProperties.push("_special");
+        test.equal(m.clone()._special, "bacon", "cloning respects momentProperties");
+        moment.momentProperties.pop();
+
+        test.done();
+    },
+
     "undefined" : function (test) {
         test.expect(1);
         test.ok(moment().toDate() instanceof Date, "undefined");