From: Eduardo San Martin Morote Date: Wed, 29 May 2024 07:06:25 +0000 (+0200) Subject: docs: minor fixes X-Git-Tag: @pinia/nuxt@0.5.2~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4a743fbf08cce13f84d9d29c59bf59b00ad7802e;p=thirdparty%2Fvuejs%2Fpinia.git docs: minor fixes --- 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: