Skip to content

Commit

Permalink
Adding legacy hint for useFakeTimers (software-mansion#2876)
Browse files Browse the repository at this point in the history
Updating documentation for jest >= 27 since the 'modern' useFakeTimers does not work (yet) with react-native: jestjs/jest#10221

## Checklist

- [ ] Included code example that can be used to test this change
- [ ] Updated TS types
- [ ] Added TS types tests
- [ ] Added unit / integration tests
- [X] Updated documentation
- [ ] Ensured that CI passes
  • Loading branch information
Andarius authored and aeddi committed Mar 22, 2022
1 parent 17ea70a commit 6f08c2a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/docs/guide/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ If you have custom babel configuration for testing, make sure that Reanimated's
#### Timers
You can use jest timers to control animation
```js
jest.useFakeTimers();
jest.useFakeTimers(); // jest.useFakeTimers('legacy') for jest >= 27
// call animation
jest.runAllTimers();
```
Expand Down Expand Up @@ -91,4 +91,4 @@ More example tests you can see in our repository
## Recommended testing library

- [@testing-library/react-native](https://callstack.github.io/react-native-testing-library/)
- [@testing-library/react-hooks](https://react-hooks-testing-library.com/) - for dealing with hooks
- [@testing-library/react-hooks](https://react-hooks-testing-library.com/) - for dealing with hooks

0 comments on commit 6f08c2a

Please sign in to comment.