sourced
sourced copied to clipboard
Merge of snapshot with Entity null properties fails
We ran into a problem when properties of sourced entities are declared and initialized with null.
function TestNullPropertyEntity () {
this.property = null;
Entity.call(this);
}
util.inherits(TestNullPropertyEntity, Entity);
This test fails:
it('should merge a complex snapshot when entity is initialized with null properties', function () {
var snapshot = {
property: { subProperty: true },
};
var test = new TestNullPropertyEntity();
test.merge(snapshot);
test.should.have.property('property');
test.property.should.have.property('subProperty', true);
});
@AlexZeitler see my comment on your PR! I closed it due to the entity.js rewrite, so we'll have to see where it can be added back in.