title: Jest error: TypeError: Cannot read properties of undefined (reading 'send')
body: <p>I'm fairly new to jest testing and thought I'd write a simple test for one of my controls that simply sends an array of user objects, or a simple string statement if the array is empty. So this test should just pass the text &quot;No users found&quot;.</p>
  <p>Here is the simple test I wrote:</p>
  <pre><code>test('Should return a string statment *No users found*', () =&gt; {
      expect(getAllUsers().toBe('No users found'));
  });
  </code></pre>
  <p>Not sure what I'm doing wrong here...</p>
  <p>Here is the error I'm getting:</p>
  <pre><code> TypeError: Cannot read properties of undefined (reading 'send')
  
         6 |
         7 | export const getAllUsers = (req, res) =&gt; {
      &gt;  8 |     if(users.length === 0) res.send('No users found');
           |                                ^
         9 |     res.send(users);
        10 | };
        11 |
  </code></pre>