jest ignores .babelrc when using babel 7

Created on 2 Oct 2018  路  3Comments  路  Source: facebook/jest

馃悰 Bug Report

Following the docs for using with babel 7 did not work. The babel config was ignored so it barfed on import.

To Reproduce

Follow the jest documentation for babel 7.

Expected behavior

I expect jest to work with babel 7.

Link to repl or repo (highly encouraged)

https://github.com/dadamssg/jest-babel-7

Run npx envinfo --preset jest

Paste the results here:

  System:
    OS: macOS High Sierra 10.13.6
    CPU: x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
  Binaries:
    Node: 8.11.1 - ~/.nvm/versions/node/v8.11.1/bin/node
    Yarn: 1.6.0 - /usr/local/bin/yarn
    npm: 5.6.0 - ~/.nvm/versions/node/v8.11.1/bin/npm
  npmPackages:
    jest: ^23.6.0 => 23.6.0 

Most helpful comment

Finally figured it out. It appears that {modules: false} in my babel.config.js was the problem.

All 3 comments

Please follow the guide and use babel.config.js instead of .babelrc to make Babel transpile code inside node_modules

@thymikee I tried that initially. I updated the repo. It now uses babel.config.js and still does not work.

Finally figured it out. It appears that {modules: false} in my babel.config.js was the problem.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Antho2407 picture Antho2407  路  3Comments

ticky picture ticky  路  3Comments

jardakotesovec picture jardakotesovec  路  3Comments

StephanBijzitter picture StephanBijzitter  路  3Comments

paularmstrong picture paularmstrong  路  3Comments