Skip to content

Commit

Permalink
Clarified babel-jest dependencies requirements (#285)
Browse files Browse the repository at this point in the history
Fixes #273
  • Loading branch information
IlCallo authored and ahnpnl committed Jun 10, 2019
1 parent 2219e5f commit 4f1504d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,9 @@ This tells `ts-jest` (a preprocessor this preset using to transform TS files) to

Some vendors publish their sources without transpiling. You need to say jest to transpile such files manually since `typescript` (and thus `ts-jest` used by this preset) do not transpile them.

1. Install `@babel/preset-env` and add `babel.config.js` (or modify existing if needed) with the following content:
1. Install dependencies required by Jest official documentation for [Babel integration](https://jest-bot.github.io/jest/docs/babel.html).

2. Install `@babel/preset-env` and add `babel.config.js` (or modify existing if needed) with the following content:
```js
module.exports = function(api) {
api.cache(true);
Expand All @@ -403,7 +405,7 @@ module.exports = function(api) {

*Note: do not use a `.babelrc` file otherwise the packages that you specify in the next step will not be picked up. CF [Babel documentation](https://babeljs.io/docs/en/configuration#what-s-your-use-case) and the comment `You want to compile node_modules? babel.config.js is for you!`*.

2. Update Jest configuration (by default TypeScript process untranspiled JS files which is source of the problem):
3. Update Jest configuration (by default TypeScript process untranspiled JS files which is source of the problem):

```js
{
Expand Down

0 comments on commit 4f1504d

Please sign in to comment.