Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug/FR: expect(...).toBeObservable(of(...)) should work #65

Open
Bielik20 opened this issue Oct 18, 2018 · 2 comments
Open

Bug/FR: expect(...).toBeObservable(of(...)) should work #65

Bielik20 opened this issue Oct 18, 2018 · 2 comments
Labels
enhancement New feature or request

Comments

@Bielik20
Copy link

const value = of('foo');
const expected = of('foo');
expect(value).toBeObservable(expected);

Current Behavior

VSCode informs that Argument of type 'Observable<string>' is not assignable to parameter of type 'ObservableWithSubscriptions' and compilation throws TypeError: Cannot read property 'indexOf' of undefined.

Expected Behavior

Should be able to compare two observables.

Rationale

jasmine-marbles allows this kind of comparisons.

@just-jeb just-jeb added the enhancement New feature or request label Nov 22, 2018
@TheDevelolper
Copy link

  • 1

@jrista
Copy link

jrista commented Sep 26, 2019

This is a severe shortcoming of the jest-marbles library. It does not appear possible to test observables that come from the unit under test given the typing involved in the jest-marbles matchers. Since they must be ObservableWithSubscriptions, which in turn is defined as HotObservable | ColdObservable, it won't match any REAL observable...

The jasmine-marbles matchers type the toBeObservable matcher as simply any.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants