-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
SyntaxError: Unexpected reserved word
when using nativeBase
#2488
Comments
You're probably using Node 4. On Node 6 & 7 Babel supports better errors for this kind of issues: import Drawer from './Components/vendor/react-native-drawer';
^^^^^^
SyntaxError: Unexpected token import Not sure how we can fix this. |
yes I was in 4.0 i have updated and got your same issue, i will update the first post, thanks :) |
It seems that Jest is not transforming
|
Thank you @rogeliog! |
to leave it as reference If anyone else gets here the correct setting would be "jest": {
"preset": "react-native",
"transformIgnorePatterns": [
"node_modules/?!(react-native|native-base)"
]
} tested and worked |
I was having the same issue, shouldn't Jest ignore those transforms on react-native since they are all using ES6+? |
Ask the question on react native repo ;) |
@thymikee: can you please elaborate how and why this question belongs to react native repo instead of here? |
Sure, react native maintains its preset, which you're probably using. |
\node_modules@yellowspot\ng-truncate\dist\index.js:1
at ScriptTransformer._transformAndBuildScript (node_modules/jest-runtime/build/script_transformer.js:316:17) I have tried but didn't worked.. Any thoughts , thanks in advance |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Do you want to request a feature or report a bug?
Bug report
What is the current behavior?
jest fails to run test on react component when using nativeBase with
this is on the import line :
i am not sure what is being taken there as a reserved word (remove the line will actually solve remove the specific error).
If the current behavior is a bug, please provide the steps to reproduce and either a repl.it demo through https://repl.it/languages/jest or a minimal repository on GitHub that we can
yarn install
andyarn test
.https://github.com/kanekotic/jest_syntax_error
What is the expected behavior?
the test to pass :P
Please provide your exact Jest configuration and mention your Jest, node, yarn/npm version and operating system.
The text was updated successfully, but these errors were encountered: