From 059d1c094a5b9e09a7470e5e45c1f505b6b8d48f Mon Sep 17 00:00:00 2001 From: Iskren Chernev Date: Tue, 29 Jul 2014 22:25:04 -0700 Subject: [PATCH] Add test for momentProperties and cloning --- test/moment/create.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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"); -- 2.47.2