React-Native tests failed

Viewed 526

i searched on stackoverflow but i didn't find my problem. I dev an apps only on android, using React-Native-cookies's native module, and now i have to create some unit test. I am using Jest, and i make one. But now, everytime i want to test it, it is not possible because i didn't configured my xCode project. It doesn't take sense because i haven't changed evything on the ios app. Here is my error :

> jest

 PASS  __tests__\index.ios.js
 FAIL  __tests__\index.android.js
  ● Test suite failed to run

    Invariant Violation: react-native-cookies: Add RNCookieMangerIOS.h and RNCookieManagerIOS.m to your Xcode project

      at invariant (node_modules/invariant/invariant.js:42:15)
      at Object.<anonymous> (node_modules/react-native-cookies/index.js:10:1)
      at Object.<anonymous> (App/App/Cookie.js:7:25)
      at Object.<anonymous> (App/App/Mattermost.js:11:13)

 FAIL  App\App\__tests__\Mattermost.test.js
  ● Test suite failed to run

    Invariant Violation: react-native-cookies: Add RNCookieMangerIOS.h and RNCookieManagerIOS.m to your Xcode project

      at invariant (node_modules/invariant/invariant.js:42:15)
      at Object.<anonymous> (node_modules/react-native-cookies/index.js:10:1)
      at Object.<anonymous> (App/App/Cookie.js:7:25)
      at Object.<anonymous> (App/App/Mattermost.js:11:13)

Test Suites: 2 failed, 1 passed, 3 total
Tests:       1 passed, 1 total
Snapshots:   0 total
Time:        1.547s, estimated 3s
Ran all test suites.
npm ERR! Test failed.  See above for more details.

So i wonder if someone could help me? Thanks

EDIT : forgetted to post the unit test :

import Mattermost from "../Mattermost";
let mattermost = new Mattermost();



test('Rendering Test', () => {
    mattermost.setState({
        MMAUTHTOKEN : "test debug",
    });
    expect(mattermost.render.contain(<WebView ref={'webview'} automaticallyAdjustContentInsets={false} style={Style.webview} source={{uri: URLMATTERMOST}} javaScriptEnabled={true} onNavigationStateChange={this.onNavigationStateChange.bind(this)} startInLoadingState={true} scalesPageToFit={true}/>)).to.equal(true);
});
0 Answers
Related