ecmascript 6 - Unexpected import token - testing React Native with Jest -


i'm getting weird import error when try test react-native app jest. have babel-jest, babel-preset-react-native, jest, jest-react-native , react-test-render installed error message when run npm test.

● test suite failed run

/users/maftalion/www/stars20/kiosk/node_modules/native-base/index.js:4 import drawer './components/vendor/react-native-drawer'; ^^^^^^ **syntaxerror: unexpected token import**    @ transformandbuildscript (node_modules/jest-runtime/build/transform.js:316:10)   @ object.<anonymous> (src/routes/identification.js:3:17)   @ object.<anonymous> (src/routes/router.js:4:21) 

test suites: 1 failed, 1 passed, 2 total tests: 1 passed, 1 total snapshots: 1 passed, 1 total time: 1.011s

figured out, throw node modules use es6 syntax in transformignorepatterns.

"transformignorepatterns": [ "node_modules/(?!react-native|native-base|react-clone-referenced-element)" ],


Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -