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 'react-native'; | |
import {act} from 'react-test-renderer'; | |
import {componentDriver} from 'react-component-driver'; | |
import Example from '../App'; | |
const getExampleDriver = () => componentDriver(Example, { | |
toggleAwesome(value) { | |
this.getByID('awesome').props.onValueChange(value); | |
return this; | |
}, |
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 React from 'react'; | |
import {Button, SafeAreaView, Switch, Text, View} from 'react-native'; | |
function CheckBox({value, label, onValueChange, testID}) { | |
return ( | |
<View style={{flexDirection: 'row', justifyContent: 'space-between', padding: 10}}> | |
<Text>{label}</Text> | |
<Switch onValueChange={onValueChange} value={value} testID={testID}/> | |
</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
const mockAsBasicComponent = (name) => { | |
const React = require('react'); | |
const RealComponent = require.requireActual(name); | |
const BasicComponent = {[name]: props => React.createElement(name, props)}[name]; | |
BasicComponent.propTypes = RealComponent.propTypes; | |
return BasicComponent; | |
} | |
jest.mock('TouchableOpacity', () => mockAsBasicComponent('TouchableOpacity')); | |
jest.mock('Switch', () => mockAsBasicComponent('Switch')); |
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
curl -O http://python-distribute.org/distribute_setup.py | |
python distribute_setup.py | |
curl -O https://bootstrap.pypa.io/get-pip.py | |
python get-pip.py |