Skip to content

Instantly share code, notes, and snippets.

@ofirdagan
Created November 12, 2016 21:48
Show Gist options
  • Save ofirdagan/716fb68cccdb35e0c80b09f815ba19a0 to your computer and use it in GitHub Desktop.
Save ofirdagan/716fb68cccdb35e0c80b09f815ba19a0 to your computer and use it in GitHub Desktop.
enzyme drivers driver
// 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
class MyDriver extends RNDriver {
get text() {
return this.childrenOf('textFromProp');
}
tap() {
this.tapOn('textFromProp');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment