3
votes

What is the difference between:

expectObservable(e1.merge(e2)).toBe(expected);

and

expect(e1.merge(e2)).toBeObservable(expected);

syntax?

Is it matter of a testing library or just a flavor?

2

2 Answers

2
votes

Based on my usage: toBeObservable is from third party library, jasmine-marbles

expectObservable is from build in rxjs module: TestScheduler.

1
votes

Seems like the official repos use a .toBeObservable matcher.

https://github.com/synapse-wireless-labs/jasmine-marbles/blob/master/spec/integration.spec.ts

https://github.com/cartant/rxjs-marbles

Not sure why the RxJS documentation uses expectObservable()