-
Notifications
You must be signed in to change notification settings - Fork 665
Closed
Labels
Description
Version
1.0.0-beta.29
Reproduction link
https://codesandbox.io/s/20yl7w8y6y
Steps to reproduce
In the Code Sandbox run the tests - they will fail.
Due to the way Code Sandbox runs tests if you re-run them they'll pass the second time. You can make them run properly again by refreshing the page or deleting a semicolon somewhere in the file.
Commenting out either line in the handler
function will cause the tests to pass.
What is expected?
Inside watchers, you should be able to save the component data into a variable and then set it.
What is actually happening?
Saving component data in a variable and then setting the data inside a watcher fails tests in the latest version of vue/vue-test-utils. This has caused many tests to suddenly fail in our application.
Stack trace (from CodeSandbox):
Cannot read property '$options' of undefined
TypeError: Cannot read property '$options' of undefined
at updateChildComponent (https://20yl7w8y6y.codesandbox.io/node_modules/vue/dist/vue.common.dev.js:2984:8)
at prepatch (https://20yl7w8y6y.codesandbox.io/node_modules/vue/dist/vue.common.dev.js:4388:5)
at patchVnode (https://20yl7w8y6y.codesandbox.io/node_modules/vue/dist/vue.common.dev.js:6180:7)
at VueComponent.patch [as __patch__] (https://20yl7w8y6y.codesandbox.io/node_modules/vue/dist/vue.common.dev.js:6352:9)
at VueComponent.Vue._update (https://20yl7w8y6y.codesandbox.io/node_modules/vue/dist/vue.common.dev.js:2815:19)
at VueComponent.updateComponent (https://20yl7w8y6y.codesandbox.io/node_modules/vue/dist/vue.common.dev.js:2933:10)
at Watcher.get (https://20yl7w8y6y.codesandbox.io/node_modules/vue/dist/vue.common.dev.js:3330:25)
at Watcher.run (https://20yl7w8y6y.codesandbox.io/node_modules/vue/dist/vue.common.dev.js:3405:22)
at flushSchedulerQueue (https://20yl7w8y6y.codesandbox.io/node_modules/vue/dist/vue.common.dev.js:3163:13)
at queueWatcher (https://20yl7w8y6y.codesandbox.io/node_modules/vue/dist/vue.common.dev.js:3252:9)
at Watcher.update (https://20yl7w8y6y.codesandbox.io/node_modules/vue/dist/vue.common.dev.js:3395:5)
at Dep.notify (https://20yl7w8y6y.codesandbox.io/node_modules/vue/dist/vue.common.dev.js:740:13)
at Object.reactiveSetter [as myData] (https://20yl7w8y6y.codesandbox.io/node_modules/vue/dist/vue.common.dev.js:1065:11)
at VueComponent.proxySetter [as myData] (https://20yl7w8y6y.codesandbox.io/node_modules/vue/dist/vue.common.dev.js:3482:26)
at VueComponent.handler (https://20yl7w8y6y.codesandbox.io/test.spec.js:21:21)
at VueComponent.Vue.$watch (https://20yl7w8y6y.codesandbox.io/node_modules/vue/dist/vue.common.dev.js:3797:12)
at createWatcher (https://20yl7w8y6y.codesandbox.io/node_modules/vue/dist/vue.common.dev.js:3754:13)
at initWatch (https://20yl7w8y6y.codesandbox.io/node_modules/vue/dist/vue.common.dev.js:3736:7)
at initState (https://20yl7w8y6y.codesandbox.io/node_modules/vue/dist/vue.common.dev.js:3499:5)
at VueComponent.Vue._init (https://20yl7w8y6y.codesandbox.io/node_modules/vue/dist/vue.common.dev.js:4877:5)
at new VueComponent (https://20yl7w8y6y.codesandbox.io/node_modules/vue/dist/vue.common.dev.js:5024:12)
at createComponentInstanceForVnode (https://20yl7w8y6y.codesandbox.io/node_modules/vue/dist/vue.common.dev.js:4546:10)
at init (https://20yl7w8y6y.codesandbox.io/node_modules/vue/dist/vue.common.dev.js:4377:45)
at createComponent (https://20yl7w8y6y.codesandbox.io/node_modules/vue/dist/vue.common.dev.js:5850:9)
at createElm (https://20yl7w8y6y.codesandbox.io/node_modules/vue/dist/vue.common.dev.js:5797:9)
at VueComponent.patch [as __patch__] (https://20yl7w8y6y.codesandbox.io/node_modules/vue/dist/vue.common.dev.js:6347:7)
at VueComponent.Vue._update (https://20yl7w8y6y.codesandbox.io/node_modules/vue/dist/vue.common.dev.js:2812:19)
at VueComponent.updateComponent (https://20yl7w8y6y.codesandbox.io/node_modules/vue/dist/vue.common.dev.js:2933:10)
at Watcher.get (https://20yl7w8y6y.codesandbox.io/node_modules/vue/dist/vue.common.dev.js:3330:25)
at new Watcher (https://20yl7w8y6y.codesandbox.io/node_modules/vue/dist/vue.common.dev.js:3319:12)
at mountComponent (https://20yl7w8y6y.codesandbox.io/node_modules/vue/dist/vue.common.dev.js:2940:3)
at VueComponent.Vue.$mount (https://20yl7w8y6y.codesandbox.io/node_modules/vue/dist/vue.common.dev.js:8898:10)
at VueComponent.Vue.$mount (https://20yl7w8y6y.codesandbox.io/node_modules/vue/dist/vue.common.dev.js:11692:16)
at mount (https://20yl7w8y6y.codesandbox.io/node_modules/@vue/test-utils/dist/vue-test-utils.js:8649:21)
at shallowMount (https://20yl7w8y6y.codesandbox.io/node_modules/@vue/test-utils/dist/vue-test-utils.js:8677:10)
at Object.eval (https://20yl7w8y6y.codesandbox.io/test.spec.js:34:33)
at https://codesandbox.io/static/js/vendors~sandbox.5596247f.chunk.js:1:180690
at new Promise (<anonymous>)
at t.callAsyncFn (https://codesandbox.io/static/js/vendors~sandbox.5596247f.chunk.js:1:180353)
at https://codesandbox.io/static/js/sandbox.37038f94.js:1:186582
at g (https://codesandbox.io/static/js/common-sandbox.458a22cf.chunk.js:1:11215)
at Generator._invoke (https://codesandbox.io/static/js/common-sandbox.458a22cf.chunk.js:1:11003)
at Generator.e.(anonymous function) [as next] (https://codesandbox.io/static/js/common-sandbox.458a22cf.chunk.js:1:11394)
at r (https://codesandbox.io/static/js/common-sandbox.458a22cf.chunk.js:1:702)
at u (https://codesandbox.io/static/js/common-sandbox.458a22cf.chunk.js:1:912)
at https://codesandbox.io/static/js/common-sandbox.458a22cf.chunk.js:1:971
at new Promise (<anonymous>)
at https://codesandbox.io/static/js/common-sandbox.458a22cf.chunk.js:1:853
at https://codesandbox.io/static/js/sandbox.37038f94.js:1:186850
at https://codesandbox.io/static/js/sandbox.37038f94.js:1:185325
jansalwowski, xiaosu, dsseng, fsblemos, KaelWD and 5 more