-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
✨ enhancementNew feature or requestNew feature or request🧪 pkg:testingRelated to the @pinia/testing packageRelated to the @pinia/testing package
Description
What problem is this solving
createTestingPinia()
can stub or spy all actions but in some cases, it's useful to stub only a few ones
Proposed solution
-
Adapt the option of stubActions for { include, exclude }
-
Document that you can mock a specific action:
const counter = useStore() vi.spyOn(counter, 'increment').mockImplementation(() => {}) // or if using testing pinia counter.increment.mockImplementation()
- see https://pinia.vuejs.org/cookbook/testing.html#Mocking-the-returned-value-of-an-action to have the second version wor
Describe alternatives you've considered
No response
AndreyYolkin
Metadata
Metadata
Assignees
Labels
✨ enhancementNew feature or requestNew feature or request🧪 pkg:testingRelated to the @pinia/testing packageRelated to the @pinia/testing package
Type
Projects
Status
📋 Backlog