TestScheduler

2020-10-13 18:22 更新
class TestScheduler extends VirtualTimeScheduler {
      static parseMarblesAsSubscriptions(marbles: string, runMode: boolean = false): SubscriptionLog
      static parseMarbles(marbles: string, values?: any, errorValue?: any, materializeInnerObservables: boolean = false, runMode: boolean = false): TestMessage[]
      constructor(assertDeepEqual: (actual: any, expected: any) => boolean | void)
      get hotObservables: HotObservable<any>[]
      get coldObservables: ColdObservable<any>[]
      assertDeepEqual: (actual: any, expected: any) => boolean | void
      createTime(marbles: string): number
      createColdObservable<T = string>(marbles: string, values?: { [marble: string]: T; }, error?: any): ColdObservable<T>
      createHotObservable<T = string>(marbles: string, values?: { [marble: string]: T; }, error?: any): HotObservable<T>
      expectObservable(observable: Observable<any>, subscriptionMarbles: string = null): ({...})
      expectSubscriptions(actualSubscriptionLogs: SubscriptionLog[]): ({...})
      flush()
      run<T>(callback: (helpers: RunHelpers) => T): T

     
      // inherited from index/VirtualTimeScheduler
      protected static frameTimeFactor: number
      constructor(SchedulerAction: typeof AsyncAction = VirtualAction as any, maxFrames: number = Number.POSITIVE_INFINITY)
      frame: number
      index: number
      maxFrames: number
      flush(): void
    }

静态方法

parseMarblesAsSubscriptions() static parseMarblesAsSubscriptions(marbles: string, runMode: boolean = false): SubscriptionLog

参量 类型
marbles 类型: string
运行模式 可选的。 默认值为 false。类型: boolean

Returns SubscriptionLog

parseMarbles() static parseMarbles(marbles: string, values?: any, errorValue?: any, materializeInnerObservables: boolean = false, runMode: boolean = false): TestMessage[]

参量 类型
marbles 类型: string
values 可选的。 默认值为 undefined。类型: any
errorValue 可选的。 默认值为 undefined。类型: any
materializeInnerObservables 可选的。 默认值为 false。         类型: boolean
runMode 可选的。 默认值为 false。类型: boolean

Returns TestMessage[]

建设者

constructor(assertDeepEqual: (actual: any, expected: any) => boolean | void)

参量 类型
assertDeepEqual 类型: (actual: any, expected: any) => boolean | void

物产

属性 类型 描述
hotObservables HotObservable<any>[] 只读。
coldObservables ColdObservable<any>[] 只读。
assertDeepEqual (actual: any, expected: any) => boolean | void 在构造函数中声明。

方法

createTime() createTime(marbles: string): number

参量 类型
marbles 类型: string

Returns number

createColdObservable() createColdObservable<T = string>(marbles: string, values?: { [marble: string]: T; }, error?: any): ColdObservable<T>

参量 类型
marbles A diagram in the marble DSL. Letters map to keys in values if provided.
values 可选的。 默认值为 undefined。用于中的字母的值 marbles。 如果省略,则使用字母本身。
error 可选的。 默认值为 undefined。The error to use for the # marble (if present).Returns  ColdObservable<T>

createHotObservable() createHotObservable<T = string>(marbles: string, values?: { [marble: string]: T; }, error?: any): HotObservable<T>

参量 类型
marbles A diagram in the marble DSL. Letters map to keys in values if provided.
values 可选的。 默认值为 undefined。用于中的字母的值 marbles。 如果省略,则使用字母本身。
error 可选的。 默认值为 undefined。The error to use for the # marble (if present).

Returns HotObservable<T>

ExpectObservable() expectObservable(observable: Observable<any>, subscriptionMarbles: string = null): ({toBe: observableToBeFn; })

参量 类型
observable 类型: Observable
subscriptionMarbles 可选的。 默认值为 null。类型: string

Returns ({ toBe: observableToBeFn; })

ExpectSubscriptions() expectSubscriptions(actualSubscriptionLogs: SubscriptionLog[]): ({toBe: subscriptionLogsToBeFn; })

参量 类型
actualSubscriptionLogs 类型: SubscriptionLog[]

Returns ({ toBe: subscriptionLogsToBeFn; })

flush()
flush()  参量  没有参数。

run()

run<T>(callback: (helpers: RunHelpers) => T): T

参量 类型
callback 类型: (helpers: RunHelpers) => T

Returns T

以上内容是否对您有帮助:
在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号