codler / react-native-keyboard-aware-scroll-view

A ScrollView component that handles keyboard appearance and automatically scrolls to focused TextInput.
https://www.npmjs.com/package/@codler/react-native-keyboard-aware-scroll-view
38 stars 16 forks source link

Jest test failed #5

Closed Aung-Myint-Thein closed 3 years ago

Aung-Myint-Thein commented 4 years ago

Hello, I am trying to run the test after updating the Native Base 2.13.13 and I got the following error.

Details:

    /Users/xxx/node_modules/@codler/react-native-keyboard-aware-scroll-view/index.js:3
    import listenToKeyboardEvents from './lib/KeyboardAwareHOC'
    ^^^^^^

    SyntaxError: Cannot use import statement outside a module
        at compileFunction (<anonymous>)

      at Runtime._execModule (node_modules/jest-runtime/build/index.js:1179:56)
      at Object.<anonymous> (node_modules/native-base/src/basic/Content.js:5:1)

Any tip on how to solve this? Thanks!

duongntb94 commented 4 years ago

I saw the same issue. Don't know how to fix it yet.

AronBe commented 4 years ago

Facing the same issue with Jest

ikidnapmyself commented 4 years ago

duplicate issue. as @KovaxG said, you need to ignore the module. please see transformIgnorePatterns at Jest documentation.

Sorry, this issue was part of jest, and it had nothing to do with the module, just needed to add this package to transformIgnorePatterns.

https://github.com/codler/react-native-keyboard-aware-scroll-view/issues/3