Skip to content

Commit

Permalink
docs: fix links
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed Jun 26, 2024
1 parent c38fa0d commit 7df51d5
Show file tree
Hide file tree
Showing 98 changed files with 2,958 additions and 2,386 deletions.
25 changes: 25 additions & 0 deletions packages/docs/api/@pinia/nuxt/functions/default.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
editLink: false
---

[**API Documentation**](../../../index.md)**Docs**

***

[API Documentation](../../../index.md) / [@pinia/nuxt](../index.md) / default

# Function: default()

> **default**(`this`, `inlineOptions`, `nuxt`): `_ModuleSetupReturn`
## Parameters

**this**: `void`

**inlineOptions**: [`ModuleOptions`](../interfaces/ModuleOptions.md)

**nuxt**: `Nuxt`

## Returns

`_ModuleSetupReturn`
21 changes: 21 additions & 0 deletions packages/docs/api/@pinia/nuxt/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
editLink: false
---

[**API Documentation**](../../index.md)**Docs**

***

[API Documentation](../../index.md) / @pinia/nuxt

# @pinia/nuxt

## Index

### Interfaces

- [ModuleOptions](interfaces/ModuleOptions.md)

### Functions

- [default](functions/default.md)
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,37 @@
editLink: false
---

[API Documentation](../index.md) / [@pinia/nuxt](../modules/pinia_nuxt.md) / ModuleOptions
[**API Documentation**](../../../index.md) **Docs**

# Interface: ModuleOptions
***

[API Documentation](../../../index.md) / [@pinia/nuxt](../index.md) / ModuleOptions

[@pinia/nuxt](../modules/pinia_nuxt.md).ModuleOptions
# Interface: ModuleOptions

## Properties

### disableVuex
### disableVuex?

`Optional` **disableVuex**: `boolean`
> `optional` **disableVuex**: `boolean`
Pinia disables Vuex by default, set this option to `false` to avoid it and
use Pinia alongside Vuex (Nuxt 2 only)

**`Default`**
#### Default

`true`

___
***

### storesDirs
### storesDirs?

`Optional` **storesDirs**: `string`[]
> `optional` **storesDirs**: `string`[]
Automatically add stores dirs to the auto imports. This is the same as
directly adding the dirs to the `imports.dirs` option. If you want to
also import nested stores, you can use the glob pattern `./stores/**`

**`Default`**
#### Default

`['stores']`
32 changes: 32 additions & 0 deletions packages/docs/api/@pinia/testing/functions/createTestingPinia.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
editLink: false
---

[**API Documentation**](../../../index.md)**Docs**

***

[API Documentation](../../../index.md) / [@pinia/testing](../index.md) / createTestingPinia

# Function: createTestingPinia()

> **createTestingPinia**(`options`): [`TestingPinia`](../interfaces/TestingPinia.md)
Creates a pinia instance designed for unit tests that **requires mocking**
the stores. By default, **all actions are mocked** and therefore not
executed. This allows you to unit test your store and components separately.
You can change this with the `stubActions` option. If you are using jest,
they are replaced with `jest.fn()`, otherwise, you must provide your own
`createSpy` option.

## Parameters

**options**: [`TestingOptions`](../interfaces/TestingOptions.md) = `{}`

options to configure the testing pinia

## Returns

[`TestingPinia`](../interfaces/TestingPinia.md)

a augmented pinia instance
22 changes: 22 additions & 0 deletions packages/docs/api/@pinia/testing/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
editLink: false
---

[**API Documentation**](../../index.md)**Docs**

***

[API Documentation](../../index.md) / @pinia/testing

# @pinia/testing

## Index

### Interfaces

- [TestingOptions](interfaces/TestingOptions.md)
- [TestingPinia](interfaces/TestingPinia.md)

### Functions

- [createTestingPinia](functions/createTestingPinia.md)
Original file line number Diff line number Diff line change
Expand Up @@ -2,104 +2,96 @@
editLink: false
---

[API Documentation](../index.md) / [@pinia/testing](../modules/pinia_testing.md) / TestingOptions
[**API Documentation**](../../../index.md) **Docs**

# Interface: TestingOptions
***

[API Documentation](../../../index.md) / [@pinia/testing](../index.md) / TestingOptions

[@pinia/testing](../modules/pinia_testing.md).TestingOptions
# Interface: TestingOptions

## Properties

### createSpy
### createSpy()?

`Optional` **createSpy**: (`fn?`: (...`args`: `any`[]) => `any`) => (...`args`: `any`[]) => `any`
> `optional` **createSpy**: (`fn`?) => (...`args`) => `any`
Function used to create a spy for actions and `$patch()`. Pre-configured
with `jest.fn` in Jest projects or `vi.fn` in Vitest projects if
`globals: true` is set.

#### Type declaration

▸ (`fn?`): (...`args`: `any`[]) => `any`
#### Parameters

##### Parameters

| Name | Type |
| :------ | :------ |
| `fn?` | (...`args`: `any`[]) => `any` |

##### Returns
**fn?**

`fn`
#### Returns

▸ (`...args`): `any`
`Function`

##### Parameters

| Name | Type |
| :------ | :------ |
| `...args` | `any`[] |
• ...**args**: `any`[]

##### Returns

`any`

___
***

### fakeApp
### fakeApp?

`Optional` **fakeApp**: `boolean`
> `optional` **fakeApp**: `boolean`
Creates an empty App and calls `app.use(pinia)` with the created testing
pinia. This allows you to use plugins while unit testing stores as
plugins **will wait for pinia to be installed in order to be executed**.
Defaults to false.

___
***

### initialState
### initialState?

`Optional` **initialState**: [`StateTree`](../modules/pinia.md#StateTree)
> `optional` **initialState**: [`StateTree`](../../../pinia/type-aliases/StateTree.md)
Allows defining a partial initial state of all your stores. This state gets applied after a store is created,
allowing you to only set a few properties that are required in your test.

___
***

### plugins
### plugins?

`Optional` **plugins**: [`PiniaPlugin`](pinia.PiniaPlugin.md)[]
> `optional` **plugins**: [`PiniaPlugin`](../../../pinia/interfaces/PiniaPlugin.md)[]
Plugins to be installed before the testing plugin. Add any plugins used in
your application that will be used while testing.

___
***

### stubActions
### stubActions?

`Optional` **stubActions**: `boolean`
> `optional` **stubActions**: `boolean`
When set to false, actions are only spied, but they will still get executed. When
set to true, actions will be replaced with spies, resulting in their code
not being executed. Defaults to true. NOTE: when providing `createSpy()`,
it will **only** make the `fn` argument `undefined`. You still have to
handle this in `createSpy()`.

___
***

### stubPatch
### stubPatch?

`Optional` **stubPatch**: `boolean`
> `optional` **stubPatch**: `boolean`
When set to true, calls to `$patch()` won't change the state. Defaults to
false. NOTE: when providing `createSpy()`, it will **only** make the `fn`
argument `undefined`. You still have to handle this in `createSpy()`.

___
***

### stubReset
### stubReset?

`Optional` **stubReset**: `boolean`
> `optional` **stubReset**: `boolean`
When set to true, calls to `$reset()` won't change the state. Defaults to
false.
78 changes: 78 additions & 0 deletions packages/docs/api/@pinia/testing/interfaces/TestingPinia.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
---
editLink: false
---

[**API Documentation**](../../../index.md)**Docs**

***

[API Documentation](../../../index.md) / [@pinia/testing](../index.md) / TestingPinia

# Interface: TestingPinia

Pinia instance specifically designed for testing. Extends a regular
`Pinia` instance with test specific properties.

## Extends

- [`Pinia`](../../../pinia/interfaces/Pinia.md)

## Properties

### app

> **app**: `App`\<`any`\>
App used by Pinia

***

### install()

> **install**: (`app`) => `void`
#### Parameters

**app**: `App`\<`any`\>

#### Returns

`void`

#### Inherited from

[`Pinia`](../../../pinia/interfaces/Pinia.md).[`install`](../../../pinia/interfaces/Pinia.md#install)

***

### state

> **state**: `Ref`\<`Record`\<`string`, [`StateTree`](../../../pinia/type-aliases/StateTree.md)\>\>
root state

#### Inherited from

[`Pinia`](../../../pinia/interfaces/Pinia.md).[`state`](../../../pinia/interfaces/Pinia.md#state)

## Methods

### use()

> **use**(`plugin`): [`Pinia`](../../../pinia/interfaces/Pinia.md)
Adds a store plugin to extend every store

#### Parameters

**plugin**: [`PiniaPlugin`](../../../pinia/interfaces/PiniaPlugin.md)

store plugin to add

#### Returns

[`Pinia`](../../../pinia/interfaces/Pinia.md)

#### Inherited from

[`Pinia`](../../../pinia/interfaces/Pinia.md).[`use`](../../../pinia/interfaces/Pinia.md#use)
10 changes: 6 additions & 4 deletions packages/docs/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
editLink: false
---

API Documentation
**API Documentation****Docs**

***

# API Documentation

## Modules

- [@pinia/nuxt](modules/pinia_nuxt.md)
- [@pinia/testing](modules/pinia_testing.md)
- [pinia](modules/pinia.md)
- [@pinia/nuxt](@pinia/nuxt/index.md)
- [@pinia/testing](@pinia/testing/index.md)
- [pinia](pinia/index.md)
Loading

0 comments on commit 7df51d5

Please sign in to comment.