File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ A splash screen API for react-native which can programatically hide and show the
1616- [ Examples] ( #examples )
1717- [ Getting started] ( #getting-started )
1818- [ API] ( #api )
19+ - [ Testing] ( #testing )
1920- [ Contribution] ( #contribution )
2021- [ Changes] ( #changes )
2122
@@ -268,6 +269,20 @@ Method | Type | Optional | Description
268269show() | function | false | Open splash screen (Native Method )
269270hide() | function | false | Close splash screen
270271
272+ ## Testing
273+
274+ ### Jest
275+
276+ For Jest to work you will need to mock this component. Here is an example:
277+
278+ ```
279+ // __mocks__/react-native-splash-screen.js
280+ export default {
281+ show: jest.fn().mockImplementation( () => { console.log('show splash screen'); } ),
282+ hide: jest.fn().mockImplementation( () => { console.log('hide splash screen'); } ),
283+ }
284+ ```
285+
271286## Contribution
272287
273288Issues are welcome. Please add a screenshot of you bug and a code snippet. Quickest way to solve issue is to reproduce it in one of the examples.
You can’t perform that action at this time.
0 commit comments