rxjs-marbles 测试没有期望

rxjs-marbles testing has no expectations

我使用 rxjs-marbles for testing observables in my Angular 7 app. But it looks like m.expect is not recognized by jasmine 作为预期。

我有以下测试:

it('should see expectations', marbles(m => {
  const source: Observable<Message> = m.hot('^a--b--c');
  m.expect(source).toBeObservable('-a--b--c');
}));

当我 运行 它时,我在控制台中收到错误消息:

ERROR: 'Spec 'FeatureFlagsService should see expectations' has no expectations.'

同样在浏览器输出中我的测试有前缀:

SPEC HAS NO EXPECTATIONS should see expectations

添加 expect(true).toBe(true); 解决了问题,但这不是我真正想要的方式。

如何注册m.expect对茉莉的期待?

其实是lib本身造成的。我在 github 上创建了一个问题,很快就解决了:https://github.com/cartant/rxjs-marbles/issues/51