diff --git a/packages/docs/cookbook/testing.md b/packages/docs/cookbook/testing.md index 8c992b1154..7d0dd94656 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: