title: How check if static methods is called in Jest?
body: <p>I have ES-6 class which is having static methods. How to mock them in Jest to test if they gets called?</p>
  <p>I have 3 files</p>
  <ol>
  <li>Logger</li>
  </ol>
  <pre class="lang-js prettyprint-override"><code>class Logger {
    static log = (err) =&gt; {
      console.log(err);
    }
  }
  export default Logger;
  </code></pre>
  <ol start="2">
  <li>action</li>
  </ol>
  <pre class="lang-js prettyprint-override"><code>// import Logger './Logger';
  export const myAction = () =&gt; {
    handleRequest(params).then((response) =&gt; {
      // Statements
    }).catch((err) =&gt; {
      Logger.log(err);
    });
  };
  </code></pre>
  <ol start="3">
  <li>Test file</li>
  </ol>
  <pre class="lang-js prettyprint-override"><code>// import {myAction} from './action';
  // import Logger './Logger';
  it('should call Logger', () =&gt; {
    Logger.log = jest.fn();
    return myAction().then(() =&gt; {
      expect(Logger.log).toHaveBeenCalled(); // It is failing
    });
  });
  </code></pre>