title: How to test "this" calling context with jest?
body: <p>How does one test in <code>jest</code> that a function is called with the right <code>this</code> context?</p>
  
  <p>I only was able to find how to test for arguments passed in, with <a href="https://jest-bot.github.io/jest/docs/expect.html#tohavebeencalledwitharg1-arg2-" rel="nofollow noreferrer">toHaveBeenCalledWith</a>. But it doesn't test <code>this</code> context, and I can't find any other API for this or examples.</p>