Marble testing with RxJS testing utils

You don’t need a third-party library for marble testing

Kevin Kreuzer
5 min readAug 6, 2019

Once you start your path to master Observables, the chances are high that you already encountered a marble diagram on your way.

The marble syntax is a very intuitive syntax to represent streams, and it is often used to visualize observable transformations. It is not only a form of documentation, but it can also be used to test our Observables.

From consulting various developers, I have seen that teams often take advantage of a third-party library to apply marble testing. Using a third-party library is a valid approach, and there’s nothing wrong with it. But!

You can actually “marble test” without using a third-party library! 🤩

What this blog post is about

This blog post shows you how to “marble test” without a third-party library. It assumes that you’re already familiar with the marble syntax and marble testing itself.

If you have never written a marble test before you might want to check out this great introduction from Benjamin Cabanes

--

--

Kevin Kreuzer
Kevin Kreuzer

Written by Kevin Kreuzer

Passionate freelance frontend engineer. ❤️ Always eager to learn, share and expand knowledge.

Responses (7)