Skip to content

Commit

Permalink
Add test for extendDeep getting prototype methods
Browse files Browse the repository at this point in the history
Previously extendDeep would copy methods from the prototype.  With
recent changes those are dropped.  This test shows that.
  • Loading branch information
Michael Hunter committed May 22, 2016
1 parent 7aec91f commit 72b3746
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/1-protected-test.js
Expand Up @@ -168,6 +168,11 @@ vows.describe('Protected (hackable) utilities test')
var extWith = {elem3:{sub2:"val6",sub3:"val7"}};
CONFIG.util.extendDeep({}, orig, extWith);
assert.deepEqual(orig, shouldBe);
},
'Keeps prototype methods intact': function() {
var orig = Object.create({has: function() {}});
var result = CONFIG.util.extendDeep({}, orig, {});
assert.isFunction(result.has);
}
},

Expand Down

0 comments on commit 72b3746

Please sign in to comment.