err example: https://github.com/cloudyan/babel-7
just babel-7, but is not working outside the jest project examples
# 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.
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.
Most helpful comment
Please kindly read the docs about running Jest with Babel 7: https://jestjs.io/docs/en/getting-started#using-babel