Skip to content

Commit

Permalink
Add test for momentProperties and cloning
Browse files Browse the repository at this point in the history
  • Loading branch information
ichernev committed Jul 30, 2014
1 parent 24fbb01 commit 059d1c0
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/moment/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 059d1c0

Please sign in to comment.