You will need to use `babel.config.js` in order to transpile `node_modules`. See https://babeljs.io/docs/en/next/config-files for more information.
You can also see the example in the Jest repository: https://github.com/facebook/jest/tree/master/examples/babel-7
*注意：如果你使用了 `npm` 3 或 4，或者 Yarn，就不用再显式的安装 `regenerator-runtime` 这个包了。*
别忘了在你的项目根文件夹下添加一个 [`.babelrc`](https://babeljs.io/docs/usage/babelrc/) 配置文件。 For example, if you are using ES6 and [React.js](https://facebook.github.io/react/) with the [`babel-preset-env`](https://babeljs.io/docs/plugins/preset-env/) and [`babel-preset-react`](https://babeljs.io/docs/plugins/preset-react/) presets:
```json
{
"presets": ["env", "react"]
}

现在你就完成了使用所有 ES6 特性和 React 特殊语法所需的配置了。

Note: If you are using a more complicated Babel configuration, using Babel's env option, keep in mind that Jest will automatically define NODE_ENV as test. 它不会像 Babel 那样在 NODE_ENV 没有被设置时默认使用 development。

Note: If you've turned off transpilation of ES6 modules with the option { "modules": false }, you have to make sure to turn this on in your test environment.