Skip to content
This repository has been archived by the owner on Jan 11, 2022. It is now read-only.

Cannot run the tests #23

Closed
adashst opened this issue Feb 5, 2018 · 3 comments
Closed

Cannot run the tests #23

adashst opened this issue Feb 5, 2018 · 3 comments

Comments

@adashst
Copy link

adashst commented Feb 5, 2018

When running the tests with yarn test, an Unexpected token import error occurs, because import is not transpiled.

I have to run the tests in testing-environment.
so my package.json looks like:

scripts: {
    "test": "export NODE_ENV=testing && jest"
}

and the .babelrc is:

"env": {
    "testing": {
      "presets": ["env", "react"]
    }
  }

See also: jestjs/jest#3202

@dan-lee
Copy link
Owner

dan-lee commented Feb 5, 2018

Thank you for reporting this, I definitely can reproduce this. But alas it's not fixed with your suggestion. That's strange, because tests where running fine before 🤔

@adashst
Copy link
Author

adashst commented Feb 5, 2018

I use following versions "babel-jest": "22.1.0" and "jest": "22.1.4"
I found, that its enough for me to change test in .babelrc to testing.
Then the tests work.

@dan-lee
Copy link
Owner

dan-lee commented Feb 10, 2018

Should now be fine with the latest packages installed.

@dan-lee dan-lee closed this as completed Feb 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants