# Interface: GameTestingAPI<TGame, T> (/pixi-vn/index/interfaces/GameTestingAPI)



Defined in: [src/core/testing.ts:46](https://github.com/DRincs-Productions/pixi-vn/blob/5bb5bb1f92e38998ea2f477b600168d8da3ece19/src/core/testing.ts#L46)

The object attached to `window` (and returned) by `enable`. Every action method
merges the most recent props passed to `setProps` with any `extraProps` given here,
then delegates to the matching narration/history call — so calling these behaves exactly
like a real player action (the same `navigate`/`t`/`toast`/etc. the real UI uses).

`narration`, `storage`, `stepHistory` and `Game` are also exposed directly for anything not
covered by the action methods (e.g. `storage.set(...)`, `Game.exportGameState()`).

## Type Parameters [#type-parameters]

### TGame [#tgame]

`TGame`

### T [#t]

`T` *extends* `object` = \{ }

## Properties [#properties]

### errors [#errors]

\> `readonly` **errors**: [`GameTestingErrorEntry`](/pixi-vn/index/interfaces/GameTestingErrorEntry)\[]

Defined in: [src/core/testing.ts:101](https://github.com/DRincs-Productions/pixi-vn/blob/5bb5bb1f92e38998ea2f477b600168d8da3ece19/src/core/testing.ts#L101)

Errors caught via `Game.addOnError` since `enable()` was called (or since the last [clearErrors](#clearerrors)).

***

### Game [#game]

\> `readonly` **Game**: `TGame`

Defined in: [src/core/testing.ts:47](https://github.com/DRincs-Productions/pixi-vn/blob/5bb5bb1f92e38998ea2f477b600168d8da3ece19/src/core/testing.ts#L47)

***

### narration [#narration]

\> `readonly` **narration**: [`NarrationManagerInterface`](/pixi-vn/index/interfaces/NarrationManagerInterface)

Defined in: [src/core/testing.ts:48](https://github.com/DRincs-Productions/pixi-vn/blob/5bb5bb1f92e38998ea2f477b600168d8da3ece19/src/core/testing.ts#L48)

***

### props [#props]

\> `readonly` **props**: [`StepLabelPropsType`](/pixi-vn/index/type-aliases/StepLabelPropsType)\<`T`>

Defined in: [src/core/testing.ts:57](https://github.com/DRincs-Productions/pixi-vn/blob/5bb5bb1f92e38998ea2f477b600168d8da3ece19/src/core/testing.ts#L57)

The most recent props passed to `setProps` — whatever your app's `StepLabelProps`
augmentation defines (e.g. `navigate`, `toast`). Useful to drive the app's UI directly
during a test session — e.g. `pixiVN.props.navigate("/settings")` — not just narration,
for full control over what's on screen.

***

### stepHistory [#stephistory]

\> `readonly` **stepHistory**: [`HistoryManagerInterface`](/pixi-vn/index/interfaces/HistoryManagerInterface)

Defined in: [src/core/testing.ts:50](https://github.com/DRincs-Productions/pixi-vn/blob/5bb5bb1f92e38998ea2f477b600168d8da3ece19/src/core/testing.ts#L50)

***

### storage [#storage]

\> `readonly` **storage**: [`StorageManagerInterface`](/pixi-vn/index/interfaces/StorageManagerInterface)

Defined in: [src/core/testing.ts:49](https://github.com/DRincs-Productions/pixi-vn/blob/5bb5bb1f92e38998ea2f477b600168d8da3ece19/src/core/testing.ts#L49)

## Methods [#methods]

### call() [#call]

\> **call**(`label`, `extraProps?`): `Promise`\<[`StepLabelResultType`](/pixi-vn/index/type-aliases/StepLabelResultType)>

Defined in: [src/core/testing.ts:69](https://github.com/DRincs-Productions/pixi-vn/blob/5bb5bb1f92e38998ea2f477b600168d8da3ece19/src/core/testing.ts#L69)

[narrationUtils.NarrationManagerInterface.call](/pixi-vn/index/interfaces/NarrationManagerInterface#call) using the live props plus any `extraProps`.

#### Parameters [#parameters]

##### label [#label]

`string` | [`LabelAbstract`](/pixi-vn/index/classes/LabelAbstract)\<`any`, `T`, `number`>

##### extraProps? [#extraprops]

`Partial`\<`T`>

#### Returns [#returns]

`Promise`\<[`StepLabelResultType`](/pixi-vn/index/type-aliases/StepLabelResultType)>

***

### clearErrors() [#clearerrors]

\> **clearErrors**(): `void`

Defined in: [src/core/testing.ts:102](https://github.com/DRincs-Productions/pixi-vn/blob/5bb5bb1f92e38998ea2f477b600168d8da3ece19/src/core/testing.ts#L102)

#### Returns [#returns-1]

`void`

***

### closeAllLabels() [#closealllabels]

\> **closeAllLabels**(): `void`

Defined in: [src/core/testing.ts:97](https://github.com/DRincs-Productions/pixi-vn/blob/5bb5bb1f92e38998ea2f477b600168d8da3ece19/src/core/testing.ts#L97)

[narrationUtils.NarrationLabelsInterface.closeAll](/pixi-vn/index/interfaces/NarrationLabelsInterface#closeall). **Can end the game.**

#### Returns [#returns-2]

`void`

***

### closeCurrentLabel() [#closecurrentlabel]

\> **closeCurrentLabel**(): `void`

Defined in: [src/core/testing.ts:95](https://github.com/DRincs-Productions/pixi-vn/blob/5bb5bb1f92e38998ea2f477b600168d8da3ece19/src/core/testing.ts#L95)

[narrationUtils.NarrationLabelsInterface.closeCurrent](/pixi-vn/index/interfaces/NarrationLabelsInterface#closecurrent)

#### Returns [#returns-3]

`void`

***

### continue() [#continue]

\> **continue**(`extraProps?`, `options?`): `Promise`\<[`StepLabelResultType`](/pixi-vn/index/type-aliases/StepLabelResultType)>

Defined in: [src/core/testing.ts:64](https://github.com/DRincs-Productions/pixi-vn/blob/5bb5bb1f92e38998ea2f477b600168d8da3ece19/src/core/testing.ts#L64)

[narrationUtils.NarrationManagerInterface.continue](/pixi-vn/index/interfaces/NarrationManagerInterface#continue) using the live props plus any `extraProps`.

#### Parameters [#parameters-1]

##### extraProps? [#extraprops-1]

`Partial`\<`T`>

##### options? [#options]

###### runNow? [#runnow]

`boolean`

###### steps? [#steps]

`number`

#### Returns [#returns-4]

`Promise`\<[`StepLabelResultType`](/pixi-vn/index/type-aliases/StepLabelResultType)>

***

### getState() [#getstate]

\> **getState**(): [`GameTestingState`](/pixi-vn/index/interfaces/GameTestingState)

Defined in: [src/core/testing.ts:99](https://github.com/DRincs-Productions/pixi-vn/blob/5bb5bb1f92e38998ea2f477b600168d8da3ece19/src/core/testing.ts#L99)

A snapshot of dialogue/choices/input/canContinue/canGoBack/labels — see [GameTestingState](/pixi-vn/index/interfaces/GameTestingState).

#### Returns [#returns-5]

[`GameTestingState`](/pixi-vn/index/interfaces/GameTestingState)

***

### goBack() [#goback]

\> **goBack**(`extraProps?`, `options?`): `Promise`\<[`StepLabelResultType`](/pixi-vn/index/type-aliases/StepLabelResultType)>

Defined in: [src/core/testing.ts:90](https://github.com/DRincs-Productions/pixi-vn/blob/5bb5bb1f92e38998ea2f477b600168d8da3ece19/src/core/testing.ts#L90)

[historyUtils.HistoryManagerInterface.back](/pixi-vn/index/interfaces/HistoryManagerInterface#back) using the live props plus any `extraProps`.

#### Parameters [#parameters-2]

##### extraProps? [#extraprops-2]

`Partial`\<`T`>

##### options? [#options-1]

###### steps? [#steps-1]

`number`

#### Returns [#returns-6]

`Promise`\<[`StepLabelResultType`](/pixi-vn/index/type-aliases/StepLabelResultType)>

***

### jump() [#jump]

\> **jump**(`label`, `extraProps?`): `Promise`\<[`StepLabelResultType`](/pixi-vn/index/type-aliases/StepLabelResultType)>

Defined in: [src/core/testing.ts:74](https://github.com/DRincs-Productions/pixi-vn/blob/5bb5bb1f92e38998ea2f477b600168d8da3ece19/src/core/testing.ts#L74)

[narrationUtils.NarrationManagerInterface.jump](/pixi-vn/index/interfaces/NarrationManagerInterface#jump) using the live props plus any `extraProps`.

#### Parameters [#parameters-3]

##### label [#label-1]

`string` | [`LabelAbstract`](/pixi-vn/index/classes/LabelAbstract)\<`any`, `T`, `number`>

##### extraProps? [#extraprops-3]

`Partial`\<`T`>

#### Returns [#returns-7]

`Promise`\<[`StepLabelResultType`](/pixi-vn/index/type-aliases/StepLabelResultType)>

***

### selectChoice() [#selectchoice]

\> **selectChoice**(`choiceIndex`, `extraProps?`): `Promise`\<[`StepLabelResultType`](/pixi-vn/index/type-aliases/StepLabelResultType)>

Defined in: [src/core/testing.ts:83](https://github.com/DRincs-Productions/pixi-vn/blob/5bb5bb1f92e38998ea2f477b600168d8da3ece19/src/core/testing.ts#L83)

Selects the currently open choice with this `choiceIndex` (as seen in
`getState().choices`), using the live props plus any `extraProps`.

#### Parameters [#parameters-4]

##### choiceIndex [#choiceindex]

`number`

##### extraProps? [#extraprops-4]

`Partial`\<`T`>

#### Returns [#returns-8]

`Promise`\<[`StepLabelResultType`](/pixi-vn/index/type-aliases/StepLabelResultType)>

#### Throws [#throws]

when no open choice has that index.

***

### setInput() [#setinput]

\> **setInput**(`value`): `void`

Defined in: [src/core/testing.ts:88](https://github.com/DRincs-Productions/pixi-vn/blob/5bb5bb1f92e38998ea2f477b600168d8da3ece19/src/core/testing.ts#L88)

Resolves a pending `narration.input.request(...)` with `value`, exactly like the player typing an answer and confirming.

#### Parameters [#parameters-5]

##### value [#value]

[`StorageElementType`](/pixi-vn/index/type-aliases/StorageElementType)

#### Returns [#returns-9]

`void`

***

### start() [#start]

\> **start**(`label`, `extraProps?`): `Promise`\<[`StepLabelResultType`](/pixi-vn/index/type-aliases/StepLabelResultType)>

Defined in: [src/core/testing.ts:59](https://github.com/DRincs-Productions/pixi-vn/blob/5bb5bb1f92e38998ea2f477b600168d8da3ece19/src/core/testing.ts#L59)

`Game.start` using the live props plus any `extraProps`.

#### Parameters [#parameters-6]

##### label [#label-2]

`string` | [`LabelAbstract`](/pixi-vn/index/classes/LabelAbstract)\<`any`, `T`, `number`>

##### extraProps? [#extraprops-5]

`Partial`\<`T`>

#### Returns [#returns-10]

`Promise`\<[`StepLabelResultType`](/pixi-vn/index/type-aliases/StepLabelResultType)>
