Skip to content

Commit

Permalink
Add test for sinonjs#2203
Browse files Browse the repository at this point in the history
  • Loading branch information
sjoseph7 committed Oct 18, 2020
1 parent 3b1fa42 commit 1aa75b0
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions test/extend-test.js
Expand Up @@ -77,4 +77,30 @@ describe("extend", function() {

assert.equals(result, expected);
});

it("does not attempt to write to 'name' property if it is not [[writable]]", function() {
var object1 = { prop1: null };

Object.defineProperty(object1, "name", {
configurable: false,
enumerable: true,
value: "not-writable",
writable: false
});

var object2 = {
prop2: "hey",
name: "write-attempt"
};

var result = extend(object1, object2);

var expected = {
prop1: null,
prop2: "hey",
name: "not-writable"
};

assert.equals(result, expected);
});
});

0 comments on commit 1aa75b0

Please sign in to comment.