title: How do I test (jest) to expect return?
body: <p>Using Jest how do I test for <code>return</code></p>
  
  <p>For example using Lambda:</p>
  
  <pre><code>exports.handler = async (event, context, callback) =&gt; {
    try {
      const orders = await getOrders();
  
      if (!orders) {
        console.log("There is no Orders");
        return; //&lt;&lt; How do test this?
      }
  
      // Something else
    } catch (err) {
      throw new;
    }
  };
  </code></pre>
  
  <p>I am able to test the console log but I also like to test to expect <code>return</code> as well</p>
  
  <p>Currently I am using this in the test:</p>
  
  <pre><code>  it("should terminate if there is no order", async () =&gt; {
      console.log = jest.fn();
  
      let order = await func.handler();
       expect(console.log.mock.calls[0][0]).toBe('There is no Orders');
    });
  </code></pre>