title: How to add Jest to React app built in Parcel.js
body: <p>I have a React App built with parcel.js. I've added Jest and I'm attempting to run a basic test, but it looks like the code is not being transformed before hitting the test <code>Jest encountered an unexpected token</code>.</p>
  
  <p>I'm not sure if the Parcel.js part is a red herring, but it's the thing that's a little different from the examples out there.</p>
  
  <p>package.json</p>
  
  <pre><code>{
  "name": "cool-tool",
  "version": "1.0.0",
  "description": "cool tool",
  "main": "public/main.js",
  "directories": {
  "test": "tests"
  },
  "dependencies": {
   "react": "^16.4.1",
   "react-dom": "^16.4.1"
  },
  "devDependencies": {
   "babel-cli": "^6.26.0",
   "babel-jest": "^23.4.2",
   "babel-preset-env": "^1.7.0",
   "babel-preset-react": "^6.24.1",
   "jest": "^23.4.2",
   "parcel-bundler": "^1.9.7",
   "react-test-renderer": "^16.4.2"
  },
  "scripts": {
   "test": "jest --debug",
   "start": "parcel watch assets/js/troubleshooting.js --out-dir public/js",
   "build": "parcel build assets/js/troubleshooting.js --out-dir public/js"
  },
  "jest": {
   "testEnvironment": "node"
  },
  "repository": {
  "type": "git",
  "url": "shhhh.git"
  },
  "author": "me",
  "license": "ISC"
  }
  </code></pre>
  
  <p>the babel.rc</p>
  
  <pre><code>{
    "presets": ["env", "react"]
  }
  </code></pre>
  
  <p>Jest run with the <code>--debug</code> option</p>
  
  <pre><code>    {
    "configs": [
        {
          "automock": false,
          "browser": false,
          "cache": true,
          "cacheDirectory": "/var/folders/v4/0kv69mcn5530g0gshbwwqfgr0000gn/T/jest_dx",
          "clearMocks": false,
          "coveragePathIgnorePatterns": [
          "/node_modules/"
          ],
          "detectLeaks": false,
          "detectOpenHandles": false,
          "errorOnDeprecated": false,
          "filter": null,
          "forceCoverageMatch": [],
          "globals": {},
          "haste": {
          "providesModuleNodeModules": []
          },
          "moduleDirectories": [
          "node_modules"
          ],
          "moduleFileExtensions": [
          "js",
          "json",
          "jsx",
          "node"
          ],
          "moduleNameMapper": {},
          "modulePathIgnorePatterns": [],
          "name": "6f41d9651941a1101334b070800aeec1",
          "prettierPath": null,
          "resetMocks": false,
          "resetModules": false,
          "resolver": null,
          "restoreMocks": false,
          "rootDir": "/Users/me/Projects/coolproject",
          "roots": [
          "/Users/me/Projects/coolproject"
          ],
          "runner": "jest-runner",
          "setupFiles": [
          "/Users/me/Projects/coolproject/node_modules/regenerator-runtime/runtime.js"
          ],
          "setupTestFrameworkScriptFile": null,
          "skipFilter": false,
          "snapshotSerializers": [],
          "testEnvironment": "/Users/me/Projects/coolproject/node_modules/jest-environment-node/build/index.js",
          "testEnvironmentOptions": {},
          "testLocationInResults": false,
          "testMatch": [
          "**/__tests__/**/*.js?(x)",
          "**/?(*.)+(spec|test).js?(x)"
          ],
          "testPathIgnorePatterns": [
          "/node_modules/"
          ],
          "testRegex": "",
          "testRunner": "/Users/me/Projects/coolproject/node_modules/jest-jasmine2/build/index.js",
          "testURL": "about:blank",
          "timers": "real",
          "transform": [
          [
            "^.+\\.jsx?$",
            "/Users/me/Projects/coolproject/node_modules/babel-jest/build/index.js"
          ]
          ],
          "transformIgnorePatterns": [
          "/node_modules/"
          ],
          "watchPathIgnorePatterns": []
        }
      ],
      "globalConfig": {
      "bail": false,
      "changedFilesWithAncestor": false,
      "collectCoverage": false,
      "collectCoverageFrom": null,
      "coverageDirectory": "/Users/me/Projects/coolproject/coverage",
      "coverageReporters": [
        "json",
        "text",
        "lcov",
        "clover"
      ],
      "coverageThreshold": null,
      "detectLeaks": false,
      "detectOpenHandles": false,
      "errorOnDeprecated": false,
      "expand": false,
      "filter": null,
      "globalSetup": null,
      "globalTeardown": null,
      "listTests": false,
      "maxWorkers": 7,
      "noStackTrace": false,
      "nonFlagArgs": [],
      "notify": false,
      "notifyMode": "always",
      "passWithNoTests": false,
      "projects": null,
      "rootDir": "/Users/me/Projects/coolproject",
      "runTestsByPath": false,
      "skipFilter": false,
      "testFailureExitCode": 1,
      "testPathPattern": "",
      "testResultsProcessor": null,
      "updateSnapshot": "new",
      "useStderr": false,
      "verbose": null,
      "watch": false,
      "watchman": true
    },
    "version": "23.4.2"
  }
  </code></pre>