title: How to properly use axios.get.mockResolvedValue for async calls in jest
body: <p>I want to mock the returned value in the catch block of an async function with Jest</p>
  
  <p>This is the function I am writing the unit test for: </p>
  
  <pre><code>  try {
      make some axios request
      }
      return users;
    } catch (err) {
      return new Map();
    }
  };
  
      it('should catch error when query is unsuccessful', async () =&gt; {
        axios.get.mockRejectedValue(new Map());
        const res = getUserDataByIds('someUserIds');
        await expect(res).rejects.toThrow();
      });
  
  </code></pre>
  
  <p>I am getting the error from Jest:</p>
  
  <pre><code> expect(received).rejects.toEqual()
   Received promise resolved instead of rejected
   Resolved to value: Map {}
  </code></pre>
  
  <p>I expect that the test should pass because I'm mocking a rejected value.</p>