From 4a743fbf08cce13f84d9d29c59bf59b00ad7802e Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Wed, 29 May 2024 09:06:25 +0200 Subject: [PATCH] docs: minor fixes --- packages/docs/cookbook/testing.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/docs/cookbook/testing.md b/packages/docs/cookbook/testing.md index 8c992b11..7d0dd946 100644 --- a/packages/docs/cookbook/testing.md +++ b/packages/docs/cookbook/testing.md @@ -71,7 +71,6 @@ beforeEach(() => { title="Watch a free video of Mastering Pinia about testing stores" /> --> - This can be achieved with `createTestingPinia()`, which returns a pinia instance designed to help unit tests components. Start by installing `@pinia/testing`: @@ -214,6 +213,8 @@ const store = mockedStore(useSomeStore) store.someAction.mockResolvedValue('some value') ``` +If you are interesting in learning more tricks like this, you should check out the Testing lessons on [Mastering Pinia](https://masteringpinia.com/lessons/exercise-mocking-stores-introduction). + ### Specifying the createSpy function When using Jest, or vitest with `globals: true`, `createTestingPinia` automatically stubs actions using the spy function based on the existing test framework (`jest.fn` or `vitest.fn`). If you are not using `globals: true` or using a different framework, you'll need to provide a [createSpy](/api/interfaces/pinia_testing.TestingOptions.html#createspy) option: -- 2.47.2