sinon stub not replacing function in react component
<p>I'm trying to test a click on a react component uszing Enzyme + Sinon</p>

<pre><code>var stub = sinon.stub(Comp.prototype, 'save', function() {  });

let wrapper = shallow(
    &lt;Comp/&gt;
);

wrapper.find('.btn-header').simulate('click');
sinon.assert.called(stub);

Comp.prototype.refineOnClick.restore();
</code></pre>

<p>My Comp component has a save function that throws an exception</p>

<pre><code>save: function () {
    throw('error');
}
</code></pre>

<p>When I run the test, I expect no errors to be thrown and the empty function in the stub to fire - but it doesn't. The actual function inside the component is fired and not the empty stub.</p>