title: Run mocha test to check if object is initialized
body: <p>I have this code</p>
  <pre><code>module.exports = async function checkNetwork(context) {
      const client = new NetworkManager(
         subscriptionId,
      );
  };
  
  
  declare class NetworkManager {
      constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.NetworkManagementClientOptions);
  }
  </code></pre>
  <p>I would like to test if <code>NetworkManager</code> has been initialized. This is what I tried:</p>
  <pre><code>describe('schedule', () =&gt; {
          let revert;
          let clientFake;
          beforeEach(() =&gt; {
              clientFake = {
                  constructor: stub().resolves(),
              };
              revert = reverseProxy.__set__({
                  'NetworkManager': stub().returns(clientFake),
              });
          });
          it('run lookup', async () =&gt; {
              await stubContext(reverseProxy);
              expect(clientFake.constructor.calledOnce).to.equal(true);
      });
  </code></pre>
  <p>But this doesn't work. I am getting <code>AssertionError: expected false to equal true</code>.</p>
  <p>Can someone advice?</p>