Skip to content

Commit

Permalink
Add note about enabling module transpilation (jestjs#4252)
Browse files Browse the repository at this point in the history
This commit adds a note that explains that you have to re-enable transpiling of modules for your test environment.
  • Loading branch information
selbekk authored and cpojer committed Aug 11, 2017
1 parent 3c2e57d commit 43b6cb9
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/en/GettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,18 @@ You are now set up to use all ES6 features and React specific syntax.
keep in mind that Jest will automatically define `NODE_ENV` as `test`.
It will not use `development` section like Babel does by default when no `NODE_ENV` is set.

> Note: If you've turned off transpilation of ES2015 modules with the option `{ "modules": false }`, you have to make sure to turn this on in your test enviornment.
```json
{
"presets": [["es2015", { "modules": false }], "react"],
"env": {
"test": {
"presets": [["es2015"], "react"]
}
}
}
```

> Note: `babel-jest` is automatically installed when installing Jest and will automatically transform files if a babel configuration exists in your project. To avoid this behavior, you can explicitly reset the `transform` configuration option:
```json
Expand Down

0 comments on commit 43b6cb9

Please sign in to comment.