react - 15.4.2
react-native - 0.42.3
native-base - 2.1.0
jest - 19.0.2
The Jest test suite is expected to run & tests pass
SyntaxError: Unexpected token import when importing connectStyle in the @shoutem dependency.

This has only been tested in iOS.
just modify jest config package.json
Works for me. Seems like it's a common problem
"jest": {
"preset": "react-native",
"transformIgnorePatterns": [
"node_modules/(?!react-native|@shoutem/theme|@shoutem/animation|@shoutem/ui|tcomb-form-native)"
],
"setupFiles": [
"./test/setup.js"
]
}
I am still getting same error even after modifying jest config in package.json. Any ideas?
SOLVED: Was having multiple entries for different libraries in transformIgnorePatterns and thats why it didn't work properly. Putting all in one solved the issue.
@matejstrasek can you explain what you did ?
@sidd607 sorry for late response. If you still haven't solve it: I was putting additional elements into transformIgnorePatterns for each library and didn't work. Using all in one element and with | as @kidnapkin did, worked.
Please check this with NativeBase 2.3.3
It is not solved . Tried 2.3.3 and transformIgnorePatterns as well.
"native-base": "2.3.3",
"react": "16.0.0-beta.5",
"react-native": "0.49.3",
"jest": {
"preset": "react-native",
"transformIgnorePatterns": [
"node_modules/(?!(jest-)?react-native|react-navigation|react-clone-referenced-element|react-native-localization|native-base-shoutem-theme|@shoutem/theme|@shoutem/animation|@shoutem/ui|tcomb-form-native)"
],
"setupFiles": [
"./jest-setup.js"
]
},
"jest": {
"preset": "react-native",
"transformIgnorePatterns": [
"node_modules/(?!native-base-shoutem-theme)"
]
}
Works for me! 2.3.2
Updating the dependencies is the fix for this
There is a PR open for this #1391
Still have the problem, 2.3.2 with:
"jest": {
"preset": "react-native",
"setupFiles": [
"<rootDir>/__tests__/jest/setup.js"
],
"testPathIgnorePatterns": [
"<rootDir>/__tests__/jest/",
"<rootDir>/node_modules/"
],
"transformIgnorePatterns": [
"node_modules/(?!react-native|native-base-shoutem-theme|react-navigation)"
]
}
EDIT:
Updated my transformIgnorePatterns to:
"transformIgnorePatterns": [
"node_modules/(?!react-native|native-base|react-navigation)"
]
Works fine now.
Check out fixes for jest with 2.5.0
This issue will be closed next week in case of no response
All options for transformIgnorePatterns are not working for me on react-native 0.56
My config for jest and it resolve my problem for suthem lib .
"jest": {
"preset": "react-native",
"transformIgnorePatterns": [
"node_modules/(?!native-base-shoutem-theme|react-native)"
]
},
Most helpful comment
just modify jest config package.json
Works for me. Seems like it's a common problem