Closed
Description
This is similar to #9531.
It is not safe to assign a bunch of setters in the passed object. They may throw or they may have side effects. This isn't theoretical because we may add setters like this to React.
Example: https://repl.it/repls/HuskyCandidConfiguration
test('setter object comparison', () => {
expect({
get a() {
return {};
},
set a(value) {
throw new Error('noo');
},
b: {},
}).toEqual({
a: {},
});
});
This used to work fine in 24: https://repl.it/repls/AllMediumorchidDeals
This regression is currently blocking upgrading React to Jest 25.