# Class default

- Defined in src/test/utils/phaseInterceptor.ts:14

#####
Index

### Constructors

constructor

### Properties

PHASES
interval
intervalRun
log
onHold
phaseFrom
phases
promptInterval
prompts
scene

### Methods

addToNextPrompt
initPhases
mustRun
remove
restoreOg
run
runFrom
startPhase
startPromptHander
to
waitUntil
whenAboutToRun

## Constructors

### constructor

- new default(scene): default

- Constructor to initialize the scene and properties, and to start the phase handling.

  #### Parameters

  - scene: any

    The scene to be managed.

  #### Returns default

  - Defined in src/test/utils/phaseInterceptor.ts:65

## Properties

### `Private` PHASES

PHASES: ((typeof LoginPhase | ((phase) => void))[] | (typeof SelectGenderPhase | ((phase) => void))[] | (typeof EncounterPhase | ((phase) => void))[] | (typeof PostSummonPhase | ((phase) => void))[] | (typeof SummonPhase | ((phase) => void))[] | (typeof ToggleDoublePositionPhase | ((phase) => void))[] | (typeof CheckSwitchPhase | ((phase) => void))[] | (typeof ShowAbilityPhase | ((phase) => void))[] | (typeof MessagePhase | ((phase) => void))[] | (typeof CommandPhase | ((phase) => void))[] | (typeof EnemyCommandPhase | ((phase) => void))[] | (typeof MovePhase | ((phase) => void))[] | (typeof MoveEffectPhase | ((phase) => void))[] | (typeof DamagePhase | ((phase) => void))[] | (typeof FaintPhase | ((phase) => void))[] | (typeof SelectModifierPhase | ((phase) => void))[] | (typeof StatChangePhase | ((phase) => void))[])[] = ...

List of phases with their corresponding start methods.

- Defined in src/test/utils/phaseInterceptor.ts:28

### `Private` interval

interval: any

- Defined in src/test/utils/phaseInterceptor.ts:19

### `Private` intervalRun

intervalRun: any

- Defined in src/test/utils/phaseInterceptor.ts:21

### log

log: any

- Defined in src/test/utils/phaseInterceptor.ts:17

### `Private` onHold

onHold: any

- Defined in src/test/utils/phaseInterceptor.ts:18

### `Private` phaseFrom

phaseFrom: any

- Defined in src/test/utils/phaseInterceptor.ts:23

### phases

phases: {} = {}

#### Type declaration

- Defined in src/test/utils/phaseInterceptor.ts:16

### `Private` promptInterval

promptInterval: any

- Defined in src/test/utils/phaseInterceptor.ts:20

### `Private` prompts

prompts: any

- Defined in src/test/utils/phaseInterceptor.ts:22

### scene

scene: any

- Defined in src/test/utils/phaseInterceptor.ts:15

## Methods

### addToNextPrompt

- addToNextPrompt(phaseTarget, mode, callback, expireFn): void

- Method to add an action to the next prompt.

  #### Parameters

  - phaseTarget: string

    The target phase for the prompt.

  - mode: Mode

    The mode of the UI.

  - callback: (() => void)

    The callback function to execute.

    - - (): void

      - #### Returns void

  - expireFn: (() => void)

    The function to determine if the prompt has expired.

    - - (): void

      - #### Returns void

  - Defined in src/test/utils/phaseInterceptor.ts:257

### initPhases

- initPhases(): void

- Method to initialize phases and their corresponding methods.

  #### Returns void

  - Defined in src/test/utils/phaseInterceptor.ts:208

### mustRun

- mustRun(phaseTarget): Promise<void>

- Method to ensure a phase is run, to throw error on test if not.

  #### Parameters

  - phaseTarget: any

    The phase to run.

  #### Returns Promise<void>

  A promise that resolves when the phase is run.

  - Defined in src/test/utils/phaseInterceptor.ts:131

### remove

- remove(phaseTarget, skipFn?): Promise<void>

- Method to remove a phase from the list.

  #### Parameters

  - phaseTarget: any

    The phase to remove.

  - `Optional` skipFn: any

    Optional skip function.

  #### Returns Promise<void>

  A promise that resolves when the phase is removed.

  - Defined in src/test/utils/phaseInterceptor.ts:170

### restoreOg

- restoreOg(): void

- Restores the original state of phases and clears intervals.

  This function iterates through all phases and resets their `start` method to the original function stored in `this.phases`. Additionally, it clears the `promptInterval` and `interval`.

  #### Returns void

  - Defined in src/test/utils/phaseInterceptor.ts:272

### run

- run(phaseTarget, skipFn?): Promise<void>

- Method to run a phase with an optional skip function.

  #### Parameters

  - phaseTarget: any

    The phase to run.

  - `Optional` skipFn: any

    Optional skip function.

  #### Returns Promise<void>

  A promise that resolves when the phase is run.

  - Defined in src/test/utils/phaseInterceptor.ts:113

### runFrom

- runFrom(phaseFrom): default

- Method to set the starting phase.

  #### Parameters

  - phaseFrom: any

    The phase to start from.

  #### Returns default

  The instance of the PhaseInterceptor.

  - Defined in src/test/utils/phaseInterceptor.ts:79

### startPhase

- startPhase(phase): void

- Method to start a phase and log it.

  #### Parameters

  - phase: any

    The phase to start.

  #### Returns void

  - Defined in src/test/utils/phaseInterceptor.ts:220

### startPromptHander

- startPromptHander(): void

- Method to start the prompt handler.

  #### Returns void

  - Defined in src/test/utils/phaseInterceptor.ts:234

### to

- to(phaseTo): Promise<void>

- Method to transition to a target phase.

  #### Parameters

  - phaseTo: any

    The phase to transition to.

  #### Returns Promise<void>

  A promise that resolves when the transition is complete.

  - Defined in src/test/utils/phaseInterceptor.ts:89

### waitUntil

- waitUntil(phaseTarget, skipFn?): Promise<void>

- Method to wait until a specific phase is reached.

  #### Parameters

  - phaseTarget: any

    The phase to wait for.

  - `Optional` skipFn: any

    Optional skip function.

  #### Returns Promise<void>

  A promise that resolves when the phase is reached.

  - Defined in src/test/utils/phaseInterceptor.ts:188

### whenAboutToRun

- whenAboutToRun(phaseTarget, skipFn?): Promise<void>

- Method to execute actions when about to run a phase. Does not run the phase, stop right before.

  #### Parameters

  - phaseTarget: any

    The phase to run.

  - `Optional` skipFn: any

    Optional skip function.

  #### Returns Promise<void>

  A promise that resolves when the phase is about to run.

  - Defined in src/test/utils/phaseInterceptor.ts:154