Test should run by loading the component.
node_modules/tcomb-form-native/index.js:1
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){import t from "./lib";
^^^^^^
SyntaxError: Unexpected token import
at ScriptTransformer._transformAndBuildScript (node_modules/jest-runtime/build/script_transformer.js:305:17)
at Object.<anonymous> (app/scenes/Login/index.js:15:22)
at Object.<anonymous> (app/scenes/Login/index.test.js:3:12)
The line that is causing my test to fail: import tcomb from "tcomb-form-native"
+1
Please add this to your Jest config in the package.json file:
"transformIgnorePatterns": [
"node_modules/(?!react-native|tcomb-form-native)"
]
Most helpful comment
Please add this to your Jest config in the
package.jsonfile: