title: How to mock a css import for jest/enzyme test?
body: <p>I need to mock an imported CSS file in my jest/enzyme test:</p>
  
  <p><strong>Header.test.js</strong></p>
  
  <pre><code>import React from 'react'
  import { shallow } from 'enzyme'
  import { Header } from './Header'
  
  jest.mock('semantic-ui-css/semantic.min.css') // &lt;-- no effect...
  
  it('should render page title', () =&gt; {
    const wrapper = shallow(&lt;Header title='Test' /&gt;)
    expect(wrapper.find('title').text()).toEqual('Test')
  })
  </code></pre>
  
  <p>I do get the error for the <code>import 'semantic-ui-css/semantic.min.css'</code> line:</p>
  
  <pre><code>Test suite failed to run
  
      /Users/node_modules/semantic-ui-css/semantic.min.css:11
      @import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic&amp;subset=latin);/*!
      ^
  
      SyntaxError: Invalid or unexpected token
  </code></pre>
  
  <p>I don't need import the css file for the test. So I would like to mock that import out for the test. How can I do that?</p>
  
  <p>I tried to do <code>jest.mock('semantic-ui-css/semantic.min.css')</code> but that doesn't work.</p>
  
  <p>This is how the Header.js looks like:</p>
  
  <p><strong>Header.js</strong></p>
  
  <pre><code>import Head from 'next/head'
  import 'semantic-ui-css/semantic.min.css'
  
  export const Header = props =&gt; {
    return (
      &lt;Head&gt;
        &lt;meta http-equiv='content-type' content='text/html;charset=UTF-8' /&gt;
        &lt;meta charset='utf-8' /&gt;
        &lt;title&gt;{props.title}&lt;/title&gt;
        &lt;link rel='icon' href='/static/favicon.ico' /&gt;
        &lt;link rel='stylesheet' href='/_next/static/style.css' /&gt;
      &lt;/Head&gt;
    )
  }
  </code></pre>