You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While tackling vuejs/vue-test-utils#1503, I ran into some issues while adding a global.config option to my component. The below error occured when running the following code:
TypeError: Cannot assign to read only property 'isNativeTag' of object '#<Object>'
// @ts-ignoreimportTestComponentfrom"./TestComponent.vue";import{shallowMount}from"@vue/test-utils";import{createApp}from"vue";describe("Test Error Handler Vue 3",()=>{it("Mounts a global errorhandler without issue",async(done)=>{constapp=createApp({});app.config.errorHandler=(err: any,vm,info)=>{if(info.includes("beforeMount")){expect(err.message).toBe("test");}done();};shallowMount(TestComponent,{global: {/// the below causes the exception `Cannot assign to read only property 'isNativeTag' of object '#<Object>'`config: app.config,// the below also has problems. It looks the the type is Pick<> with almost all the values of the config. Should this be a Partial type?// config: {// errorHandler: app.config.errorHandler// }},});});});
I put a reproduction link here. This is my first time using Vue 3 and VTU 2.x so it is likely I am doing something incorrect and have no idea what I am doing 😆. Hopefully I am using this API correctly while vuejs/test-utils-docs#49 is completed.
The text was updated successfully, but these errors were encountered:
@AtofStryker Thank you for this detailed repro! You're right, it should accept a partial config without complaining. I think I fixed it in #195 , you should be able to give it a try when we emrge and release this
While tackling vuejs/vue-test-utils#1503, I ran into some issues while adding a
global.config
option to my component. The below error occured when running the following code:TypeError: Cannot assign to read only property 'isNativeTag' of object '#<Object>'
I put a reproduction link here. This is my first time using
Vue 3
andVTU 2.x
so it is likely I am doing something incorrect and have no idea what I am doing 😆. Hopefully I am using this API correctly while vuejs/test-utils-docs#49 is completed.The text was updated successfully, but these errors were encountered: