AppsFlyerSDK / appsflyer-react-native-plugin

AppsFlyer plugin for React Native
MIT License
278 stars 198 forks source link

Jest fails in react-native-appsflyer #422

Closed Joshmatjjen closed 2 years ago

Joshmatjjen commented 2 years ago

Report

Jest fails in react-native-appsflyer, even after running cd ios && pod install

Plugin Version

"@segment/analytics-react-native-plugin-appsflyer": "0.4.0" "react-native-appsflyer": "6.8.2",

On what Platform are you having the issue?

IOS

What did you do?

Yarn test

I have run pod install, also have the ios folder

What did you expect to happen?

Jest test pass

What happened instead?

jest test fails

Please provide any other relevant information.

$ jest FAIL tests/App.test.jsx ● Test suite failed to run

Invariant Violation: `new NativeEventEmitter()` requires a non-null argument.

  at invariant (node_modules/invariant/invariant.js:40:15)
  at new NativeEventEmitter (node_modules/react-native/Libraries/EventEmitter/NativeEventEmitter.js:45:7)
  at Object.<anonymous> (node_modules/react-native-appsflyer/index.js:6:31)
  at Object.<anonymous> (node_modules/@segment/analytics-react-native-plugin-appsflyer/lib/commonjs/AppsflyerPlugin.tsx:10:1)
amit-kremer93 commented 2 years ago

Hi, are you trying to run tests for your app or to run the tests that are inside appsflyer plugin?

Joshmatjjen commented 2 years ago

Hi, are you trying to run tests for your app or to run the tests that are inside appsflyer plugin?

@amit-kremer93 Running test in the app..

amit-kremer93 commented 2 years ago

you need to add transformIgnorePatterns to your jest configuration to tell jest to ignore files or folder. Read more here