Skip to content

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

@posva

Description

@posva

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions