You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had several react-native tests reporting "open handles" which prevented jest from finishing.
Jest has detected the following 1 open handle potentially keeping Jest from exiting: timeout
Description / Observed Behavior
Turns out its code related to "slow loading", which spawns a timer that is not properly terminated.
This could be a problem of the timer implementation for react-native or related to swr, don't know.
I am now using this wrapper for all my hook related tests. If that is the expected behaviour of swr in a react-native environment,
then maybe we should add this to the testing guide as a hint and maybe even export a testing helper from the package?
// Render all in a wrapper with no caching between testsconstwrapper=(props: any)=>(<SWRConfigvalue={{provider: ()=>newMap(),loadingTimeout: 0,dedupingInterval: 0}}{...props}/>)
Expected Behavior
I expected to don't need to setup a test wrapper for swr.
This discussion was converted from issue #1865 on December 20, 2022 15:28.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Bug report
I had several
react-native
tests reporting "open handles" which prevented jest from finishing.Jest has detected the following 1 open handle potentially keeping Jest from exiting: timeout
Description / Observed Behavior
Turns out its code related to "slow loading", which spawns a timer that is not properly terminated.
This could be a problem of the timer implementation for react-native or related to swr, don't know.
I am now using this wrapper for all my hook related tests. If that is the expected behaviour of swr in a react-native environment,
then maybe we should add this to the testing guide as a hint and maybe even export a testing helper from the package?
Expected Behavior
I expected to don't need to setup a test wrapper for swr.
Additional Context
SWR version: 1.2.1
Beta Was this translation helpful? Give feedback.
All reactions