I'm struggling to put the pieces together to stub a property value, and then check that it was retrieved.
For example:
var sinon = require('sinon');
var myObj = {
prop: 'foo'
};
var st = sinon.stub(myObj, 'prop').get(function getterFn() {
return 'bar';
});
console.log(myObj.prop);
console.log(st.called);
That doesn't work per
https://github.com/sinonjs/sinon/issues/1545 - st.called remains false.
So if that's not the way to do it, what is?