1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

additional test to cover last line in encodeObject

This commit is contained in:
Simon Hailes 2019-11-02 13:03:37 +00:00
parent 63cc9adeaa
commit c54509df3d

View File

@ -868,7 +868,20 @@ describe("@node-red/util/util", function() {
success.should.eql(true); success.should.eql(true);
done(); done();
}); });
it('test bad object constructor', function(done) {
var msg = {
msg: {
mystrangeobj:"hello",
constructor: {
get name(){
throw new Error('Exception in constructor name');
}
}
},
};
var result = util.encodeObject(msg);
done();
});
}); });
}); });