Created
November 12, 2016 21:48
-
-
Save ofirdagan/716fb68cccdb35e0c80b09f815ba19a0 to your computer and use it in GitHub Desktop.
enzyme drivers driver
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 | |
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