### Mocking the returned value of an action
-Actions are automatically spied but type-wise, they are still the regular actions. In order to get the correct type, we must implement a custom type-wrapper that is applies the `Mock` type to each action. **This type depends on the testing framework you are using**. Here is an example with Vitest:
+Actions are automatically spied but type-wise, they are still the regular actions. In order to get the correct type, we must implement a custom type-wrapper that applies the `Mock` type to each action. **This type depends on the testing framework you are using**. Here is an example with Vitest:
```ts
import type { Mock } from 'vitest'
If you want to add new state properties to a store or properties that are meant to be used during hydration, **you will have to add it in two places**:
- On the `store` so you can access it with `store.myState`
-- On `store.$state` so it can be used in devtools and, **be serialized during SSR**.
+- On `store.$state` so it can be used in devtools and **be serialized during SSR**.
On top of that, you will certainly have to use a `ref()` (or other reactive API) in order to share the value across different accesses:
- Testing utilities
- Plugins: extend Pinia features with plugins
- Proper TypeScript support or **autocompletion** for JS users
-- Server Side Rendering Support
+- Server Side Rendering support
- Devtools support
- - A timeline to track actions, mutations
+ - A timeline to track actions and mutations
- Stores appear in components where they are used
- Time travel and easier debugging
- Hot module replacement
### Mocking the returned value of an action
-Actions are automatically spied but type-wise, they are still the regular actions. In order to get the correct type, we must implement a custom type-wrapper that is applies the `Mock` type to each action. **This type depends on the testing framework you are using**. Here is an example with Vitest:
+Actions are automatically spied but type-wise, they are still the regular actions. In order to get the correct type, we must implement a custom type-wrapper that applies the `Mock` type to each action. **This type depends on the testing framework you are using**. Here is an example with Vitest:
```ts
import type { Mock } from 'vitest'