From: Iskren Chernev Date: Wed, 30 Jul 2014 05:25:04 +0000 (-0700) Subject: Add test for momentProperties and cloning X-Git-Tag: 2.8.0~6^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=059d1c094a5b9e09a7470e5e45c1f505b6b8d48f;p=thirdparty%2Fmoment.git Add test for momentProperties and cloning --- diff --git a/test/moment/create.js b/test/moment/create.js index a10a8a357..7f81f0c68 100644 --- a/test/moment/create.js +++ b/test/moment/create.js @@ -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");