-
Notifications
You must be signed in to change notification settings - Fork 668
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support cleaning up wrappers automagically #1236
Comments
@eddyerburgh I am interested in implementing this. Would you accept a pull request? 😃 |
Yep 😄 |
As I realized from @souldzin's comment on the pull request (#1240 (comment)), the API proposed here does not work. For a hook like Instead we could provide an |
I have updated the description now with the new suggested API and will create a new pull request tomorrow. |
What problem does this feature solve?
Currently it is necessary to call
wrapper.destroy()
/wrapper.vm.$destroy()
manually. Forgetting to do so may result in difficult to track down side effects and performance degradation (especially when not mocking Vuex).What does the proposed API look like?
Introduce a new
enableAutoDestroy()
helper which accepts a hook function such asafterEach()
to callwrapper.destroy()
as callback.The text was updated successfully, but these errors were encountered: