title: sinon spy on standalone function
body: <p>When I use Sinon on a function inside an object, it works:</p>
  
  <pre><code>function myFunc() {
      console.log('hello');
  }
  var myObj = { myFunc: myFunc };
  var spy = sinon.stub(myFunc);
  myObj.myFunc();
  expect(spy.called).to.be.true(); 
  </code></pre>
  
  <p>However, I don't know why when I use Sinon on a standalone function as follow:</p>
  
  <pre><code>function myFunc() {
      console.log('hello');
  }
  var spy = sinon.stub(myFunc);
  myFunc();
  expect(spy.called).to.be.true(); 
  </code></pre>
  
  <p>the assertion fails.</p>