You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @teja-kandula! It looks like native-base-shoutem-theme contains non-transpiled code, which is fine but not working in Jest. Jest uses babel to transpile the modules when used, so to fix this we have to extend the babel config just a bit. Over here you can see the standard transpile pattern Jest uses. You probably want to add all native-base-* or native-base-shoutem-* packages to this list. You can do that by configuring jest like:
Hi @byCedric! I have update transformIgnorePatterns as suggested but still I am getting the same error. Can you please advice on any alternative approaches as a fix.
馃悰 Bug Report
Summary of Issue
Jest test case throwing the error -> SyntaxError: Cannot use import statement outside a module:
Environment - output of
expo diagnostics
& the platform(s) you're targetingAndroid
Error :
({"Object.":function(module,exports,require,__dirname,__filename,global,jest){import connectStyle, { clearThemeCache } from "./src/connectStyle";
^^^^^^
Reproducible Demo
Please find the reproducible demo here: https://repl.it/@TejaGoud/Expo-Jest-test-case#LoginScreen.test.js
If any additional info needed please refer to this stack overflow question :
https://stackoverflow.com/questions/64771728/syntaxerror-cannot-use-import-statement-outside-a-module-when-running-jest-exp
Steps to Reproduce
Expected Behavior vs Actual Behavior
The test case shouldn't throw any import related errors.
The text was updated successfully, but these errors were encountered: