title: Vue, Jest: how to mock element-ui components ? cannot find module element.css
body: <p>My vue code calls <code>element-ui</code> modules:</p>
  
  <pre><code>// in main.js
  import { Notification } from "element-ui";
  </code></pre>
  
  <p>At first, my test was throwing</p>
  
  <blockquote>
    <p>Cannot find module 'Element' from 'test.js'</p>
  </blockquote>
  
  <p>so I mocked the module with</p>
  
  <pre><code>jest.mock('element-ui', () =&gt; ({
    Element: jest.fn(),
  }))
  </code></pre>
  
  <p>However it still errors out with</p>
  
  <blockquote>
    <p>Cannot find module 'element-ui/lib/theme-default/element.css' from 'test.js'</p>
  </blockquote>
  
  <p>and I don't know how to get passed this.</p>
  
  <p>Any ideas ? Thanks.</p>
  
  <hr>
  
  <p>If I import the element-ui components in my test.js:</p>
  
  <pre><code>ReferenceError: document is not defined
  
        at Object.&lt;anonymous&gt; (node_modules/element-ui/lib/utils/dom.js:22:39)
        at Object.&lt;anonymous&gt; (node_modules/element-ui/lib/utils/popup/popup-manager.js:9:12)
        at Object.&lt;anonymous&gt; (node_modules/element-ui/lib/utils/popup/index.js:14:21)
  </code></pre>
  
  <p>(Jest 21.2, vue-test-utils 1.0.0)</p>