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
Is your feature request related to a problem? Please describe.
Testing different values for inject/provide currently needs a complete new wrapper to be defined:
it('should do option A, if provided with "A"), () => { wrapper = shallowMount(VCommercialInfo, { props: myProps, global: { provide: { myProvide: ref('A'), }, }, }); expect(...); }); it('shoulddooptionB,ifprovidedwith"B"),()=>{
props: myProps,wrapper=shallowMount(VCommercialInfo,{global: {provide: {myProvide: ref('B'),},},});expect(...);});
This would get even more tedious when there is other data to be passed in, such as props/stubs/plugins/mocks/slots/... which would all lead to duplicate code.
Describe the solution you'd like
Would be great if we could have a setProvide function similar to setProps:
it('should do option C, if provided with "C"), async () => { await wrapper.setProvide({ myProvide: ref('C'),
});
expect(...);
});
The text was updated successfully, but these errors were encountered:
Could you could just create a function that reduces the duplication?
We used to have many things like setMethods, setComputed etc, the problem is the introduce something in your tests (changing the provided value) that cannot happen in a production environment. It led to many difficult to solve bugs, which is why setComputed does not exist anymore.
Hi @lmiller1990,
thanks for the explanation. I was not aware of that, if those other functions were removed specifically, then it probably does not make sense to introduce this one - I will go for a local solution instead.
Is your feature request related to a problem? Please describe.
Testing different values for inject/provide currently needs a complete new wrapper to be defined:
This would get even more tedious when there is other data to be passed in, such as props/stubs/plugins/mocks/slots/... which would all lead to duplicate code.
Describe the solution you'd like
Would be great if we could have a setProvide function similar to setProps:
The text was updated successfully, but these errors were encountered: