Stubbing method in same file using Sinon
<p>I'm trying to unit test a function in a file while stubbing another function in the SAME file, but the mock is not being applied and the real method is being called.  Here's an example:</p>

<pre><code>// file: 'foo.js'

export function a() {
   // .....
}

export function b() { 
   let stuff = a(); // call a
   // ...do stuff
}
</code></pre>

<p>And my test:</p>

<pre><code>import * as actions from 'foo';

const aStub = sinon.stub(actions, 'a').returns('mocked return');
actions.b(); // b() is executed, which calls a() instead of the expected aStub()
</code></pre>