-
I was trying to do some tests but I noticed that the 'disposer' of the addDisposer system is not called when a test is done. Is there anything that would help to make the disposer happen after a test is done? I'm using jest main file
test file
repro here https://github.com/cmdcolin/jest-adddisposer-issue-test |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
note that I have an odd purpose which is adding a keyboard shortcut in the afterCreate, and then ideally cleaning it up in the addDisposer callback, but i was just getting some weird test behavior due to this disposer not being called |
Beta Was this translation helpful? Give feedback.
-
Actually found a self answer, somewhere high up in my tree I can call destroy in a useEffect
|
Beta Was this translation helpful? Give feedback.
Actually found a self answer, somewhere high up in my tree I can call destroy in a useEffect