Skip to content

Commit fddb5ad

Browse files
authored
Merge pull request #227 from taranda/master
Add testing notes to README.md
2 parents 384698b + a24b670 commit fddb5ad

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff 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
268269
show() | function | false | Open splash screen (Native Method )
269270
hide() | 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

273288
Issues 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.

0 commit comments

Comments
 (0)