Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit 25371b1

Browse files
CharlesMangwaDanielMSchmidt
authored andcommitted
docs: add instructions about testing with Jest
1 parent d2b310a commit 25371b1

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

docs/FAQ.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,13 @@ title: FAQ
1111
## The Accelerometer always shows a positive value
1212

1313
The Accelerometer will always show a positive z value, because this includes the gravitation from earth.
14+
15+
## Testing with Jest
16+
17+
The library provides a mock implementation for Jest via the following line:
18+
19+
```js
20+
jest.mock('react-native-sensors', () => require('react-native-sensors/mock'))
21+
```
22+
23+
If not done already, create a file named `jestSetup.js` for instance, provide its path to Jest configuration [`setupFiles`](https://jestjs.io/docs/en/configuration.html#setupfiles-array) entry and add the aforementioned line to that setup file.

0 commit comments

Comments
 (0)