sinon stub not replacing function. : <p>I tried a dummy module and to stub it, but does not work.</p>

<p>the app.js</p>

<pre><code>function foo()
{
    return run_func()
}
function run_func()
{
    return '1'
}
exports._test = {foo: foo, run_func: run_func}
</code></pre>

<p>the test.js</p>

<pre><code>app = require("./app.js")._test
describe('test', function(){
    it('test', function(){

        var test_stub = sinon.stub(app, 'run_func').callsFake(
          function(){
            return '0'
        })
        test_stub.restore()

        var res = app.foo()
        assert.equal('0', res)
    })
})
</code></pre>

<p>I tried the advice from:
<a href="https://stackoverflow.com/questions/40805349/sinon-stub-not-replacing-function">sinon stub not replacing function</a></p>

<p>But still the same. It does not replace the function.</p>
