question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[valid-expect-in-promise] Enforce for Observable .subscribe() also

See original GitHub issue

If you use an RxJS Observable and put an expect in the subscribe callback, you run into the same issue as with promises:

it('passes', () => {
  someObservable.subscribe(() => {
    expect(false).toBe(true);
  });
});

Can valid-expect-in-promise be extended or duplicated to check for subscribe?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
SimenBcommented, May 24, 2019

Right, thanks.

PR welcome! 😀

1reaction
SimenBcommented, May 24, 2019

I like the idea! It might make more sense as a separate rule? Not sure, maybe not 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

RxJS - subscribe only once but do not complete Observable
I don't want to complete the userData observable. i still want to show data in component and maybe fire the function addToDatabase() multiple...
Read more >
OBSERVABLES, OBSERVERS & SUBSCRIPTIONS - YouTube
RxJS Observables are subscribed by Observers...Wait...what? Let's understand how that all works!Join the full Angular (it uses RxJS heavily!)
Read more >
Observables
You can return observables in your worker. It works fully transparent - just subscribe to the returned observable in the master code. The...
Read more >
Learning by Implementing: Observables | Eyas's Blog
I'll be using TypeScript and working to implement something ... The basic API for Observable is a subscribe method that takes as bunch...
Read more >
Angular Basics: Introduction to Observables (RxJS)—Part 1
It is called each time the subscribe() method of the observable object is invoked. To create an observable instance, we implement the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found