title: jest trying to parse .css
body: <p>I have a problem with jest in which no matters what I do it keeps trying to parse the css files as javascript.</p>
  
  <p>The files build properly with webpack.</p>
  
  <p>I have the following configuration for jest</p>
  
  <pre><code>"jest": {
      "rootDir": "./src",
      "moduleNameMapper": {
        "^.*[.](css|CSS)$": "../jest/styleMock.js"
      }
    },
  </code></pre>
  
  <p>I also tried a script preprocessor to strip the css from the imports:</p>
  
  <pre><code> "jest": {
      "rootDir": "./src",
      "scriptPreprocessor": "../node_modules/jest-css-modules"
    },
  </code></pre>
  
  <p>It keeps throwing the error.</p>
  
  <pre><code>({"Object.&lt;anonymous&gt;":function(module,exports,require,__dirname,__filename,global,jest){.button {
                                                                                               ^
      SyntaxError: Unexpected token .
  </code></pre>