-
Notifications
You must be signed in to change notification settings - Fork 665
setComputed does not set computed values #273
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
Comments
I put some console.logs inside of the setComputed function in vue test utils, and the value does appear to set -- I guess it's a bug elsewhere. Will keep playing around. I wonder if this is the same problem as #176 ... edit: some progress, if you do const wrapper = shallow(comp, {
computed: { b: () => 3 }
} It works fine, but not outside the constructor. Hmm... edit again: this works fine. It seems that referencing a |
Should setComputed make it so the computed function always returns the value that was set until setComputed is called again. Or do you think the computed function in your example return a different value after a changes? I have a fix if we think calling setComputed should permanently change the computed value returned. |
I think if you are setting it for the test, then it should then not be mutable by the original computer getter |
So that’s a yes to the first question in plain English :) |
If I do |
Yes, agreed. |
Seems to be a bug, I've not tested using Jest.
Using vue-cli webpack tempate.
vue-test-utils@1.0.0-beta.8
Vue 2.5
Karma 1.4.1
Mocha 3.2.0
The text was updated successfully, but these errors were encountered: