title: how to test if condition and return statement inside jest?
body: <p>I just started learning Jest.
  what are other ways to test this function for If case and return statement using Jest ?
  This is function to test with Jest</p>
  <pre><code>const extractInfo = (description: string) =&gt; {
          const info= description.match('descriptionInformation');
          if (info) {
            return info[0];
            }
           return 'hello jest';
          };
  </code></pre>
  <p>Tried below testcases to check
  Info.test.ts</p>
  <pre><code>  test('extractInfo method to be defined', () =&gt; {
      expect(extractInfo ).toBeDefined();
    });
  
    test('extractInfo to be called when Info has blank string', () =&gt; {
      const BLANK_STRING = '';
      expect(extractInfo ).toHaveBeenCalled();
      expect(extractInfo ).toHaveBeenCalledWith(BLANK_STRING);
    })
  
      const extractInfo = (Info: string) =&gt; {
          const info= description.match(jestinformation);
          if (info) {
            return info[0];
            }
           return 'hello jest';
          };
  </code></pre>
  <p>Please provide ways to cover each lines. Thank you</p>