vuejs / vue-class-component

ES / TypeScript decorator for class-style Vue components.
MIT License
5.81k stars 431 forks source link

Data is not defined on this.$data #597

Open tsiotska opened 2 years ago

tsiotska commented 2 years ago

Using 'vue-test-utils' cannot call setData on wrapper because data exists only on "this" and not on "this.$data" TypeError: Cannot add property dataText, object is not extensible await wrapper.setData({dataText: 'Test'})

I added test case for that https://github.com/tsiotska/vue-class-component/blob/fix/data-init/test/specs/test.spec.ts#L67 Could you give me some pointers how to fix this?

Also related: https://github.com/vuejs/test-utils/issues/572 https://github.com/vuejs/test-utils/issues/1058