No he escrito mucho es5, así que lo olvidé. ¿Puedes ayudar a solucionar esto?
let mock = { DynamoDB: function() { { send: function() {console.log('sending...')} } }, };entonces no funciona.
let client = new mock.DynamoDB(); client.send(); // does not write to consoleUna función constructora debería asignar a una propiedad de this .
let mock = { DynamoDB: function() { this.send = function() { console.log('sending...') } } }; let client = new mock.DynamoDB(); client.send();Necesitas usar this :
let mock = { DynamoDB: function() { { this.send = function send(){ console.log('sending...'); }; } }, }; let client = new mock.DynamoDB(); client.send();