This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import MyComp from './MyComp'; | |
ModuleRegistry.registerComponent('MyComp', () => MyComp); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ModuleRegistry.registerComponent('MyComp', () => { | |
const MyComp = require('./MyComp'); | |
reutrn MyComp; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(async function wrapper() { | |
const foo = async () => { | |
return true; | |
}; | |
const goo = async () => { | |
return Promise.resolve(true); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// setup the driver in the beforeEach | |
beforeEach(() => { | |
driver = new MyDriver({ | |
//the path is relative to the src/ folder (you can change it if you need. see api on github) | |
path: 'components/dummy-react-native-component', | |
mocks: {}, | |
}); | |
}); | |
//The driver extends the React Native Driver. We also support regular react with BaseDriver |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it('should tapOn', () => { | |
const tapSpy = jasmine.createSpy('tap'); | |
//given | |
driver.render({text: 'hello driver', onTap: tapSpy}); | |
//when | |
driver.tap(); | |
//then | |
expect(tapSpy).toHaveBeenCalled(); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it('should render component', () => { | |
//given | |
driver.render({text: 'It works!'}); | |
//then | |
expect(driver.text).toBe('It works!'); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default function DummyReactNativeComponent({text, onTap}) { | |
return ( | |
<View> | |
<Text testID="myText">Some Text</Text> | |
<Text testID="textFromProp" onPress={onTap}>{text}</Text> | |
</View> | |
); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script src="http://survey.g.doubleclick.net/async_survey?site=63uzockooaopsig3i33sh6qez4"></script> | |
</head> | |
<body> | |
Hello | |
</body> | |
</html> |