Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ActionTester

A test-framework independent test runner This encapsulates the singular functions within this library into a class

Hierarchy

Implements

Index

Properties

Private callList

callList: CallList = []

Private thunkArgs

thunkArgs: ThunkArgs = []

Accessors

calls

Methods

add

dispatch

  • dispatch(action: TestAction | Function, done?: undefined | function): Promise<unknown>
  • Dispatches an action and recursively executes all thunks of an action and it's subsequent actions.

    Parameters

    • action: TestAction | Function

      TestAction | Function

    • Optional done: undefined | function

    Returns Promise<unknown>

    Promise

index

setArgs

  • setArgs(getState?: Function | null, extraArgument?: unknown): void
  • Sets the remaining 2 arguments of a thunk action.

    Parameters

    • Optional getState: Function | null

      Mock store.getState function

    • Optional extraArgument: unknown

      Mock values injected via thunk.withExtraArgument

    Returns void

    void

toSnapshot

  • toSnapshot(): string
  • Generates a snapshot of the dispatched actions.

    Returns string

    A pretty-formatted stringified value.

toTracer

  • Gets a object containing step functions to step through the calls.

    Returns ActionTracer

    An action tracer

toTypes

  • toTypes(): string[]
  • Gets an array of action.type of dispatched actions

    Returns string[]

    An array of action.type

Generated using TypeDoc