【发布时间】:2019-10-13 03:47:27
【问题描述】:
这里是forkJoin operator jasmine marble test:
it('test1', () => {
const a = cold('---a|', { a: 1 });
const b = cold('---b|', { b: 2 });
const observable = forkJoin(
a,
b
);
const expected = cold('---21');
expect(observable).toBeObservable(expected);
});
测试产生以下错误:
Expected $[0].frame = 40 to equal 30.
Expected $[0].notification.value = [ 1, 2 ] to equal '2'.
Expected $[1].frame = 40 to equal 50.
Expected $[1].notification.kind = 'C' to equal 'N'.
Expected $[1].notification.value = undefined to equal '1'.
Expected $[1].notification.hasValue = false to equal true.
谁能告诉我我做错了什么?
【问题讨论】:
-
cold是什么?一些自定义运算符?我从来没有见过。 -
无论如何,请提供您的问题的minimal reproducible example
-
github.com/ReactiveX/rxjs/blob/master/docs_app/content/guide/… 来自 rxjs-marble-testing
标签: angular jasmine rxjs jasmine-marbles