title: How to test that ReactDOM.render and another imported function were called in Jest?
body: <p>This question is similar to <a href="https://stackoverflow.com/questions/41728059/how-to-properly-unit-test-reactdom-render-with-karma-and-phantomjs">this previous one</a> I opened. But now I'm using a different framework, <a href="https://facebook.github.io/jest/" rel="nofollow noreferrer">Jest</a>.</p>
  
  <p>My code goes like this:</p>
  
  <pre><code>import * as React from "react";
  import * as ReactDOM from "react-dom";
  
  import * as injectTapEventPlugin from "react-tap-event-plugin";
  
  import Application from "./components/Application";
  
  import "./assets/styles/theme.css";
  
  injectTapEventPlugin();
  
  ReactDOM.render(&lt;Application /&gt;, document.getElementById("root"));
  </code></pre>
  
  <p>There's 3 things that I'd like to test here:</p>
  
  <ol>
  <li><code>injectTapEventPlugin()</code> was called.</li>
  <li><code>ReactDOM.render</code> was called with the expected arguments, <code>&lt;Application /&gt;</code>, and <code>document.getElementById("root")</code>, respectively.</li>
  <li>That <code>./assets/styles/theme.css</code> was imported. I know this one is weird but this import is here so that webpack picks it up and includes it in the final bundle. Maybe this import shouldn't exist and I should make sure that <code>theme.css</code> file is lodaded in some other way.</li>
  </ol>
  
  <p>At least 1 and 2 needs to be tested I think... Jest uses Jasmine2 and I'm also using Enzyme (but that probably doesn't help here).</p>
  
  <p>Any help is appreciated :)</p>