title: Simulate keydown on document for JEST unit testing
body: <p>Using <code>JEST</code> to unit test a component that has a keydown listener attached to the document. </p>
  
  <p>How can I test this in <code>JEST</code>? How do I simulate the keydown event on the document? I need the event listener to be on the document since it is supposed to respond the keyboard action irrespective of the focussed element.</p>
  
  <p>EDIT: The question here is about simulating the event on the document or the document.body. All the examples are regarding an actual DOM node, that works fine but the document does not.</p>
  
  <p>Currently trying to do this:</p>
  
  <pre><code>TestUtils.Simulate.keyDown(document, {keyCode : 37}); // handler not invoked
  </code></pre>