jest not working use es6

Created on 13 Dec 2018  ·  2Comments  ·  Source: facebook/jest

💥 Regression Report

err example: https://github.com/cloudyan/babel-7

just babel-7, but is not working outside the jest project examples

Run

# install
yarn

npm test

err result:

> [email protected] test /Users/dwd/github/jskit/work/webtest/babel-7
> jest

 FAIL  __tests__/index.test.js
  ● Test suite failed to run

    /Users/dwd/github/jskit/work/webtest/babel-7/__tests__/index.test.js:5
    import double from '../index';
           ^^^^^^

    SyntaxError: Unexpected identifier

      at ScriptTransformer._transformAndBuildScript (node_modules/jest-runtime/build/script_transformer.js:403:17)

Test Suites: 1 failed, 1 total
Tests:       0 total
Snapshots:   0 total
Time:        1.144s
Ran all test suites.
npm ERR! Test failed.  See above for more details.
Bug

Most helpful comment

Please kindly read the docs about running Jest with Babel 7: https://jestjs.io/docs/en/getting-started#using-babel

All 2 comments

Please kindly read the docs about running Jest with Babel 7: https://jestjs.io/docs/en/getting-started#using-babel

Thank you. I finally solved it.

https://github.com/cloudyan/babel-7

Was this page helpful?
0 / 5 - 0 ratings

Related issues

paularmstrong picture paularmstrong  ·  3Comments

ianp picture ianp  ·  3Comments

jardakotesovec picture jardakotesovec  ·  3Comments

gustavjf picture gustavjf  ·  3Comments

mmcgahan picture mmcgahan  ·  3Comments