Allow bypassing getters in `@pinia/testing`
See original GitHub issueThere should be a way to bypass any getter when testing components that use a store.
Some Ideas:
-
use the
createTestingPinia()
to add a plugin that allows modifying any getter:// in a test const store = useStore() store.myGetter // getter computed value store.myGetter = newvalue store.myGetter // newvalue
-
Maybe a different way to pass options specific to stores:
createTestingPinia({ overrides: [ [useSomeStore, { getters: { /* autocompletion */ stuff: ... }}] ] })
Issue Analytics
- State:
- Created 2 years ago
- Reactions:6
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Testing stores - Pinia
Stores will, by design, be used at many places and can make testing much harder than ... Specifying the createSpy function; Mocking getters;...
Read more >Testing Pinia Data Stores in Vue - TestDriven.io
This tutorial describes how to test Pinia data stores in Vue applications.
Read more >Quick Full Pinia Course. Vue VueX Pinia Store State Action…
Next, let's try mutating several states at the same time. We go to the store file and add a new action method. We...
Read more >State Management on Vue with Pinia - YouTube
Pinia is an intuitive Vue Store, lightweight, type-safe, with an incredible devtools integration and of course, a very tropical name.
Read more >Pinia Crash Course #5 - Getters - YouTube
In this Pinia tutorial, you'll learn all about Getters and why we'd use them. Watch the whole course now (without ads) on Net...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This isn’t working properly with Typescript.
To fix this I needed to add the next line just above each getter modification
Versions
I am doing the following now (latest version 2.0.17):