title: Error when trying to run a test file on React component
body: <p>I encountered this error when I tried running a unit test for my React component. I use VSCode so I notice that when I wrote the expect().toBe(..), it doesn't auto suggest the term so I think there's something wrong with my files. I tested on another project and the autosuggestion worked fine. I only use a basic true assertion to test if the test file works or not</p>
  <pre><code>    Jest encountered an unexpected token
  
      Jest failed to parse a file. This happens e.g. when your code or its dependencies use non-standard JavaScript syntax, or when Jest is not configured to support such syntax.
  
      Out of the box Jest supports Babel, which will be used to transform your files into valid JS based on your Babel configuration.
  
      By default &quot;node_modules&quot; folder is ignored by transformers.
  
      Here's what you can do:
       • If you are trying to use ECMAScript Modules, see https://jestjs.io/docs/ecmascript-modules for how to enable it.
       • To have some of your &quot;node_modules&quot; files transformed, you can specify a custom &quot;transformIgnorePatterns&quot; in your config.
       • If you need a custom transformation specify a &quot;transform&quot; 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 &quot;moduleNameMapper&quot; config option.
  
      You'll find more details and examples of these config options in the docs:
      https://jestjs.io/docs/configuration
      For information about custom transformations, see:
      https://jestjs.io/docs/code-transformation
  
      Details:
  
      /Users/daniel/Documents/GitHub/flinder-react/src/components/FirstStep.test.js:1
      ({&quot;Object.&lt;anonymous&gt;&quot;:function(module,exports,require,__dirname,__filename,jest){import React from 'react';
                                                                                        ^^^^^^
  
      SyntaxError: Cannot use import statement outside a module
  
        at Runtime.createScriptFromCode (node_modules/jest/node_modules/jest-runtime/build/index.js:1479:14)
  
  Test Suites: 1 failed, 1 total
  Tests:       0 total
  Snapshots:   0 total
  Time:        0.311 s
  Ran all test suites.
  npm ERR! code ELIFECYCLE
  npm ERR! errno 1
  npm ERR! flinder-react@0.1.0 test: `jest`
  npm ERR! Exit status 1
  npm ERR! 
  npm ERR! Failed at the flinder-react@0.1.0 test script.
  npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
  
  npm ERR! A complete log of this run can be found in:
  npm ERR!     /Users/daniel/.npm/_logs/2021-09-03T23_14_44_337Z-debug.log
  daniel@daniels-Air flinder-react % npm run test
  
  &gt; flinder-react@0.1.0 test /Users/daniel/Documents/GitHub/flinder-react
  &gt; jest
  
   FAIL  src/components/FirstStep.test.js
    ● Test suite failed to run
  
      Jest encountered an unexpected token
  
      Jest failed to parse a file. This happens e.g. when your code or its dependencies use non-standard JavaScript syntax, or when Jest is not configured to support such syntax.
  
      Out of the box Jest supports Babel, which will be used to transform your files into valid JS based on your Babel configuration.
  
      By default &quot;node_modules&quot; folder is ignored by transformers.
  
      Here's what you can do:
       • If you are trying to use ECMAScript Modules, see https://jestjs.io/docs/ecmascript-modules for how to enable it.
       • To have some of your &quot;node_modules&quot; files transformed, you can specify a custom &quot;transformIgnorePatterns&quot; in your config.
       • If you need a custom transformation specify a &quot;transform&quot; 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 &quot;moduleNameMapper&quot; config option.
  
      You'll find more details and examples of these config options in the docs:
      https://jestjs.io/docs/configuration
      For information about custom transformations, see:
      https://jestjs.io/docs/code-transformation
  
      Details:
  
      SyntaxError: /Users/daniel/Documents/GitHub/flinder-react/src/components/FirstStep.test.js: Support for the experimental syntax 'jsx' isn't currently enabled (10:33):
  
         8 | describe('FirstStep', () =&gt; {
         9 |     it('button is disabled', () =&gt; {
      &gt; 10 |         const wrapper = shallow(&lt;FirstStep /&gt;);
           |                                 ^
        11 |         const button  = wrapper.find(&quot;Button&quot;);
        12 |         
        13 |         expect(button.props().disabled).toBe(true);
  
      Add @babel/preset-react (https://git.io/JfeDR) to the 'presets' section of your Babel config to enable transformation.
      If you want to leave it as-is, add @babel/plugin-syntax-jsx (https://git.io/vb4yA) to the 'plugins' section to enable parsing.
  
        at Parser._raise (node_modules/@babel/parser/src/parser/error.js:134:45)
        at Parser.raiseWithData (node_modules/@babel/parser/src/parser/error.js:129:17)
        at Parser.expectOnePlugin (node_modules/@babel/parser/src/parser/util.js:198:18)
        at Parser.parseExprAtom (node_modules/@babel/parser/src/parser/expression.js:1275:18)
        at Parser.parseExprSubscripts (node_modules/@babel/parser/src/parser/expression.js:652:23)
        at Parser.parseUpdate (node_modules/@babel/parser/src/parser/expression.js:632:21)
        at Parser.parseMaybeUnary (node_modules/@babel/parser/src/parser/expression.js:604:23)
        at Parser.parseExprOps (node_modules/@babel/parser/src/parser/expression.js:374:23)
        at Parser.parseMaybeConditional (node_modules/@babel/parser/src/parser/expression.js:340:23)
        at Parser.parseMaybeAssign (node_modules/@babel/parser/src/parser/expression.js:279:21)
  
  Test Suites: 1 failed, 1 total
  Tests:       0 total
  Snapshots:   0 total
  Time:        0.395 s
  Ran all test suites.
  npm ERR! code ELIFECYCLE
  npm ERR! errno 1
  npm ERR! flinder-react@0.1.0 test: `jest`
  npm ERR! Exit status 1
  npm ERR! 
  npm ERR! Failed at the flinder-react@0.1.0 test script.
  npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
  
  npm ERR! A complete log of this run can be found in:
  npm ERR!     /Users/daniel/.npm/_logs/2021-09-03T23_17_16_517Z-debug.log
  </code></pre>