title: Nodejs, Serverless expected stub function to be called once but was called 0 times
body: <p>I have been the said error when trying to create a stub from sinon in my test function. I am trying to test a function responsible to make http calls to other endpoints. I am trying to understand why Its not resolving to the output provided.</p>
  
  <pre><code>const sinon = require('sinon');
  const sandbox = sinon.createSandbox();
  
    describe('test endpoint', () =&gt; {
      it('should be test function', async () =&gt; {
        const stub = sinon.stub(someServiceMock.POST, '/funcName').resolves({ status: 204 });
        sinon.assert.calledOnce(stub);
      });
    });
  });
  </code></pre>
  
  <p>and getting <code>AssertError: expected '/funcName' to be called once but was called 0 times</code></p>
  
  <p>The object i pass in the stub is </p>
  
  <pre><code>const someServiceMock = {
    POST: {
      '/funcName': () =&gt; {},
    },
  };
  </code></pre>