Skip to content
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

Utility to generate the getter object based, bypass other actions and mutations #9

Open
posva opened this issue Mar 14, 2019 · 1 comment
Labels
enhancement New feature or request

Comments

@posva
Copy link
Owner

posva commented Mar 14, 2019

It would be great to also expose some utilities to test the store itself, for example, when testing an action, you may want to write an integration test and therefore not providing the getters but instead using the actual getters object as well as letting mutations and actions get called by dispatch and commit.
A function that generates a context object by being passed a module or store.
Still need to think about the API so it can handle rootState, rootGetters and others properly, also take care of nested modules naming with namespaced

const context = generateContext({ mutations, actions, getters }) // passing a module or store
myAction(context, parameters)
// test things
@winniehell
Copy link
Contributor

I can imagine that it's possible to reuse much of the logic in _modulesNamespaceMap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants