我对使用 jasmine-marble 进行单元测试完全陌生。
我有一个组件,代码如下:
getData() : void {
this.firstObservableClass.pipe(withLatestFrom(this.secObservableClass))
.subscribe(([firstObservResult, secObserveResult]) => {
// expected subscription results are true and true
});
}
我的规格:
const expected = cold('(cd|)', { c: true,d: true});
expect(app.getData).toBeObservable(expected)
运行 ng test 时出错:
Expected $.length = 1 to equal 4.
Expected $[0].notification.kind = 'N' to equal 'C'.