DEV Community

kreuzerk
kreuzerk

Posted on • Originally published at blog.angularindepth.com on

2 1

How to test Observables

The ultimate guide — never again be confused on how to test Observables

Reactive Programming is the new way of handling asynchronous code. And it is super powerful!

If you came across this blog post, I assume that you already wrote some lines of reactive code with RxJS if not a thousand. So I don’t have to tell you how it works and how cool it is. 😎

I guess we are all on the same page — writing productive code with RxJS is powerful and makes a lot of fun. But what about testing?

What we’re going to learn 👨‍🎓

In this blog post, we are going to see the two different strategies on how to test an Observable.

The “subscribe and assert pattern” and “marble testing”.

We will apply those strategies in different scenarios to see their advantages and downsides. The comparison of those strategies in different situations leads us to a clear picture of how to test Observables.

Find out more...

AWS GenAI LIVE image

How is generative AI increasing efficiency?

Join AWS GenAI LIVE! to find out how gen AI is reshaping productivity, streamlining processes, and driving innovation.

Learn more

Top comments (0)

AWS Q Developer image

Your AI Code Assistant

Implement features, document your code, or refactor your projects.
Built to handle large projects, Amazon Q Developer works alongside you from idea to production code.

Get started free in your IDE

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay