Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ChaiTestScheduler

Hierarchy

  • TestScheduler
    • ChaiTestScheduler

Implements

  • IScheduler

Index

Constructors

constructor

Properties

actions

actions: Array<AsyncAction<any>>

active

active: boolean

A flag to indicate whether the Scheduler is currently executing a batch of queued actions.

type

{boolean}

assertDeepEqual

assertDeepEqual: function

Type declaration

    • (actual: any, expected: any): boolean | void
    • Parameters

      • actual: any
      • expected: any

      Returns boolean | void

frame

frame: number

index

index: number

maxFrames

maxFrames: number

now

now: function

A getter method that returns a number representing the current time (at the time this function was called) according to the scheduler's own internal clock.

returns

A number that represents the current time. May or may not have a relation to wall-clock time. May or may not refer to a time unit (e.g. milliseconds).

Type declaration

    • (): number
    • Returns number

scheduled

scheduled: any

An internal ID used to track the latest asynchronous task such as those coming from setTimeout, setInterval, requestAnimationFrame, and others.

type

{any}

Static Protected frameTimeFactor

frameTimeFactor: number

Static now

now: function

Type declaration

    • (): number
    • Returns number

Methods

createColdObservable

  • createColdObservable<T>(marbles: string, values?: any, error?: any): ColdObservable<T>
  • Type parameters

    • T

    Parameters

    • marbles: string
    • Optional values: any
    • Optional error: any

    Returns ColdObservable<T>

createHotObservable

  • createHotObservable<T>(marbles: string, values?: any, error?: any): HotObservable<T>
  • Type parameters

    • T

    Parameters

    • marbles: string
    • Optional values: any
    • Optional error: any

    Returns HotObservable<T>

createTime

  • createTime(marbles: string): number
  • Parameters

    • marbles: string

    Returns number

expectObservable

  • expectObservable(observable: Observable<any>, unsubscriptionMarbles?: string): object
  • Parameters

    • observable: Observable<any>
    • Optional unsubscriptionMarbles: string

    Returns object

    • toBe: observableToBeFn

expectSubscriptions

  • expectSubscriptions(actualSubscriptionLogs: SubscriptionLog[]): object
  • Parameters

    • actualSubscriptionLogs: SubscriptionLog[]

    Returns object

    • toBe: subscriptionLogsToBeFn

flush

  • flush(): void
  • Returns void

schedule

  • schedule<T>(work: function, delay?: number, state?: T): Subscription
  • Schedules a function, work, for execution. May happen at some point in the future, according to the delay parameter, if specified. May be passed some context object, state, which will be passed to the work function.

    The given arguments will be processed an stored as an Action object in a queue of actions.

    Type parameters

    • T

    Parameters

    • work: function

      A function representing a task, or some unit of work to be executed by the Scheduler.

        • (this: Action<T>, state?: T): void
        • Parameters

          • this: Action<T>
          • Optional state: T

          Returns void

    • Optional delay: number
    • Optional state: T

    Returns Subscription

    A subscription in order to be able to unsubscribe the scheduled work.

Static parseMarbles

  • parseMarbles(marbles: string, values?: any, errorValue?: any, materializeInnerObservables?: boolean): TestMessage[]
  • Parameters

    • marbles: string
    • Optional values: any
    • Optional errorValue: any
    • Optional materializeInnerObservables: boolean

    Returns TestMessage[]

Static parseMarblesAsSubscriptions

  • parseMarblesAsSubscriptions(marbles: string): SubscriptionLog
  • Parameters

    • marbles: string

    Returns SubscriptionLog

Generated using TypeDoc