-
Notifications
You must be signed in to change notification settings - Fork 266
In MountingOptions is missing computed property #545
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
Hi! 👋 I might be wrong, but I'm not entirely sure VTU 1 provides a |
The most times that this is needed is to mock a complex computed and test it separately. |
We have a computed mounting option a looooong time ago, not in 1.1.2, though. It was removed for the same reason Since computed properties are just derived from other sources (like If you want additional guidance, please post an example of the test you'd like to write. |
This is quite a shame this was removed. Mocking computed properties made it a lot easier to use a real VueX store, but the stubbing out a specific getter for example, for a specific test: beforeEach(() => {
store = createStore({
modules: {
lists: {
namespaced: true,
state: lists.state,
mutations: lists.mutations,
getters: lists.getters,
},
},
});
actions = shallowMount(TheDashboardListActions, {
computed: { selectionModeActive: () => true },
global: {
plugins: [store],
mocks: {
$grid: { lg: false },
$screen: { touch: true },
},
},
});
}); |
In vue-test-utils v.1.1.2 there was a computed option in MountingOptions. Is this removed?
Is there a way to mock computed properties?
The text was updated successfully, but these errors were encountered: