Here is a simple component that I am trying to test using React Native 0.39 and Jest 18:
// index.ios.js
import React, { Component } from \'react\';
import { Ap
Jest is a JavaScript testing tool, it won't run code that you have written in Objective C/Swift/Java in a native module. You can mock the functionality of a native module so that you can call it from JavaScript by the approach you linked to. eg.
jest.mock('NetInfo', () => {
return {
isConnected: {
fetch: () => {
return new Promise((accept, resolve) => {
accept(true);
})
}
}
}
});