Skip to content

Jest transform issue after upgrade to the latest version #664

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

Closed
moonjava2005 opened this issue Aug 21, 2021 · 1 comment
Closed

Jest transform issue after upgrade to the latest version #664

moonjava2005 opened this issue Aug 21, 2021 · 1 comment

Comments

@moonjava2005
Copy link

moonjava2005 commented Aug 21, 2021

After I upgrade to the latest React-Native (version 0.65.0) and AsyncStorage to 1.15.5, I got this issue on unit test

Do you guys know how to fix this?

`import mergeOptions from 'merge-options';
^^^^^^

SyntaxError: Cannot use import statement outside a module
   6 | const { window } = jsdom
   7 |
>  8 | import mockAsyncStorage from '@react-native-async-storage/async-storage/jest/async-storage-mock'
     | ^
   9 |
  10 | jest.mock('@react-native-async-storage/async-storage', () => mockAsyncStorage)
  11 |

  at Runtime.createScriptFromCode (node_modules/jest-runtime/build/index.js:1479:14)
  at Object.<anonymous> (setup-jest.js:8:1)`
@tido64
Copy link
Member

tido64 commented Aug 21, 2021

Can you check if the fix in #660 solves your issue?

@tido64 tido64 closed this as completed Aug 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants