From 9337fac4d87a5adc172bb82c499c2b579d32a03e Mon Sep 17 00:00:00 2001 From: Julien Brayere Date: Mon, 24 Jan 2022 23:00:48 +0100 Subject: [PATCH] Adding legacy hint for useFakeTimers See this issue https://github.com/facebook/jest/issues/10221 for progress on support for the default 'modern' timer with react-native --- docs/docs/guide/testing.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/docs/guide/testing.md b/docs/docs/guide/testing.md index d3d9bee5ec8..c1691428cd8 100644 --- a/docs/docs/guide/testing.md +++ b/docs/docs/guide/testing.md @@ -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(); ``` @@ -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 \ No newline at end of file +- [@testing-library/react-hooks](https://react-hooks-testing-library.com/) - for dealing with hooks