-
Notifications
You must be signed in to change notification settings - Fork 668
refactor: remove update and make watchers sync #474
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
refactor: remove update and make watchers sync #474
Conversation
function setDepsSync (dep) { | ||
dep.subs.forEach((watcher) => { | ||
watcher.sync = true | ||
if (watcher.sync === true) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this right? How does it work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, this should be moved. We need a return statement so the code doesn't get stuck on circular deps, but this isn't the best place for it!
I think it is necessary to remove the link for https://github.com/vuejs/vue-test-utils/blob/dev/docs/en/README.md |
Hello, I don't understand what you mean by: remove update and make watchers sync I have a set of tests that use the setMethods function and now they don't work. I keep getting this error message: update has been removed from vue-test-utils. All updates are now synchronous by default Could you update the documentation please? For example a test like this doesn't work right now: const wrapper = mount(Foo); Thanks. |
Hi @radudalbea. The Vue reactivity system is asynchrnous by default, this update changes all watchers (which are part of the reactivity system) to run synchrnously. Can you create an issue with a reproduction of the issue you're having? |
Hi Ed,
I already posted an example. Basically every test that uses setMethods it
crashes. Most of them are mocking a method and the trigger a click event on
the wrapper. The problem is that the mocked function is not being called. I
switched to version beta 12 and it's working. Please use my previous
example and tell me if on your setup it is working.
Thanks
…On Wed, Apr 4, 2018 at 1:23 PM, Edd Yerburgh ***@***.***> wrote:
Hi @radudalbea <https://github.com/radudalbea>. The Vue reactivity system
is asynchrnous by default, this update changes all watchers (which are part
of the reactivity system) to run synchrnously.
Can you post an issue with a reproduction of the issue you're having?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#474 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AiFDn0620z692RhdbISNS3JF--VfyN6Jks5tlJ8zgaJpZM4SuiIq>
.
--
radu dalbea
[image: qualitance.com]
frontend developer
+04 (758) 250 024 <+04+(758)+250+024>, qualitance.com
<https://www.qualitance.com/>
|
Please create an issue. The issue tracker helps me keep track of problems that need to be fixed. I won't be able to investigate this for a few days and I might forget that you posted here. |
- Change Babel config file to being a JavaScript file instead of JSON. See: babel/babel#7784 - Remove vue-test-utils `update()` calls because they are not necessary anymore. See: vuejs/vue-test-utils#474
I can reproduce it at https://codesandbox.io/s/xpm8ml4lrp and I found it had been solved at pr#622 |
update
sync
option, which stops watchers being set tosync
whenfalse
closes #283