Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

it breaks Jest tests #3

Closed
ondrejrohon opened this issue Dec 7, 2017 · 2 comments
Closed

it breaks Jest tests #3

ondrejrohon opened this issue Dec 7, 2017 · 2 comments

Comments

@ondrejrohon
Copy link

ondrejrohon commented Dec 7, 2017

Hi,

I added this plugin to solve this issue: gaearon/react-hot-loader#650 but suddenly it broke my tests. I get a lot of errors like this:

SyntaxError: Identifier '_languageProp_arg' has already been declared

      at Runtime._execModule (node_modules/jest-runtime/build/index.js:520:13)
      at Object.<anonymous> (src/helpers/index.js:1:637)
      at Object.<anonymous> (src/helpers/__tests__/updateMarkers.js:2:9)
          at Generator.next (<anonymous>)
          at new Promise (<anonymous>)
      at handle (node_modules/worker-farm/lib/child/index.js:44:8)
      at process.<anonymous> (node_modules/worker-farm/lib/child/index.js:51:3)
      at emitTwo (events.js:126:13)
      at process.emit (events.js:214:7)
      at emit (internal/child_process.js:772:12)
      at _combinedTickCallback (internal/process/next_tick.js:141:11)
      at process._tickCallback (internal/process/next_tick.js:180:9)

It is ejected create-react-app. I added babel config to package.json:

"babel": {
    "presets": [
      "react-app",
      "stage-1"
    ],
    "plugins": [
      "extract-hoc/babel",
      "react-hot-loader/babel"
    ]
  },

Any ideas what might be wrong? Thanks.

@quangbuule
Copy link
Owner

I think that my plugin and react-hot-loader should be used for development only, I mean you shouldn't include those plugins for test. Related babel doc is here:
https://babeljs.io/docs/usage/babelrc/#env-option

@ondrejrohon
Copy link
Author

Correct, I figured it out literally 2 minutes ago. Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants