title: How to write Jest transformIgnorePatterns
body: <p>I have this excpetion</p>
  
  <pre><code>Jest encountered an unexpected token
  
      This usually means that you are trying to import a file which Jest cannot parse, e.g. it's not plain JavaScript.
  
      By default, if Jest sees a Babel config, it will use that to transform your files, ignoring "node_modules".
  
      Here's what you can do:
       • To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.
       • If you need a custom transformation specify a "transform" option in your config.
       • If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option.
  
      You'll find more details and examples of these config options in the docs:
      https://jestjs.io/docs/en/configuration.html
  
      Details:
  
      C:\Code\SPFx\BCO\node_modules\@microsoft\sp-core-library\lib\index.js:11
      export { default as _BrowserDetection } from './BrowserDetection';
      ^^^^^^
  
      SyntaxError: Unexpected token export
  
        19 | } from 'office-ui-fabric-react/lib/Utilities';
        20 | import { IUserProvider } from "../UserProviders/IUserProvider";
      &gt; 21 | import {
           | ^
        22 |   Environment,
        23 |   EnvironmentType
        24 | } from '@microsoft/sp-core-library';
  
        at ScriptTransformer._transformAndBuildScript (node_modules/jest/node_modules/jest-runtime/build/script_transformer.js:403:17)
        at Object.&lt;anonymous&gt; (src/webparts/BCO/components/EmployeeSelector/EmployeeSelector.tsx:21:1)
        at Object.&lt;anonymous&gt; (src/webparts/BCO/components/FieldMapping/FieldMapping.tsx:13:1)
  </code></pre>
  
  <p>And tried these transformIgnorePatterns expressions in config.json</p>
  
  <pre><code>"transformIgnorePatterns": [
    "\\node_modules\\@microsoft\\sp-dialog",
    "\\node_modules\\@microsoft\\sp-core-library",
    "node_modules/(?!sp-core-library)",
    "node_modules/(?!@microsoft/sp-core-library)"
  ],
  </code></pre>
  
  <p>and none of them worked. I run this on Windows 10 so I tried also <a href="https://jestjs.io/docs/en/cli.html#jest-regexfortestfiles" rel="noreferrer">this</a> format</p>