Open Ellisande opened 8 years ago
Feature
Add a simple method for turning a real object into a mocked object.
This will allow people to easily stub out external dependencies.
The thought is it would work something like this:
var ninja = { power: 1, name: 'Ryu', getArsenal: () => {}, killBadGuys: () => {} } var mockedNinja = mock(ninja); // mockedNinja.power === 1; // mockedNinja.name === 'Ryu'; // mockedNinja.getArsenal => replaced with a mockFunction // mockedNinja.killBadGuys => replaced with a mockFunction
What kind of issue is this? (bug, feature, etc)
Feature
What is the proposed change?
Add a simple method for turning a real object into a mocked object.
Why will this be beneficial?
This will allow people to easily stub out external dependencies.
Misc. info
The thought is it would work something like this: