[valid-expect-in-promise] Enforce for Observable .subscribe() also
See original GitHub issueIf 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:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Right, thanks.
PR welcome! 😀
I like the idea! It might make more sense as a separate rule? Not sure, maybe not 😃