【发布时间】:2019-09-13 17:14:50
【问题描述】:
假设我有效果
@Effect()
someEffect$ = this.actions$.pipe(ofType(X), switchMap(() =>
of(Y).pipe(delay(3000)))
大理石测试应该是什么样子?
const action = new X();
const result = new Y();
actions$.stream = hot('-x', { x: action });
const expected = cold('-y', { y: result }); // ? adding frames or 3s doesn't work
expect(effects.someEffect$).toBeObservable(expected);
作为回报我得到
Expected $.lenght = 0 to equal 1.
【问题讨论】:
-
这是一个非常相似的问题stackoverflow.com/questions/53427965/…。您基本上必须将调度程序传递给
delay -
谢谢,这正是我需要的。
标签: rxjs ngrx jasmine-marbles