Skip to content
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

yarn test fail in example folder #364

Open
ElieSol opened this issue Jun 18, 2020 · 1 comment
Open

yarn test fail in example folder #364

ElieSol opened this issue Jun 18, 2020 · 1 comment
Labels
bug Something isn't working enhancement New feature or request

Comments

@ElieSol
Copy link

ElieSol commented Jun 18, 2020

Hello !

I tried creating a library with an example folder in it using the command

create-react-native-module --generate-example TestLibrary

then followed create-react-native-module documentation, everything is working great except when I try to run the command yarn test in the example folder... I get the following error:

yarn run v1.22.4
$ jest
 FAIL  __tests__/App-test.js
  ● Test suite failed to run

    Invariant Violation: __fbBatchedBridgeConfig is not set, cannot invoke native modules

      1 | import { NativeModules } from 'react-native';
      2 | 
    > 3 | const { TestModule } = NativeModules;
        |                        ^
      4 | 
      5 | export default TestModule;
      6 | 

      at invariant (../node_modules/invariant/invariant.js:40:15)
      at Object.<anonymous> (../node_modules/react-native/Libraries/BatchedBridge/NativeModules.js:166:3)
      at Object.NativeModules (../node_modules/react-native/Libraries/react-native/react-native-implementation.js:323:12)
      at Object.<anonymous> (../index.js:3:24)

Test Suites: 1 failed, 1 total
Tests:       0 total
Snapshots:   0 total
Time:        1.74 s
Ran all test suites.
error Command failed with exit code 1.

I don't know if this issue is due to my configurations (i.e. react-native version etc..) or if I missed some steps...

Thank you in advance for your help :)

@brodycj brodycj added bug Something isn't working enhancement New feature or request labels Feb 17, 2021
@brodycj
Copy link
Owner

brodycj commented Feb 17, 2021

My apologies for the delay. This has never been tested or supported, needs to be documented.

I would love to get this working (someday). Thanks for reporting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants