Learning about the marble testing pattern
Marble diagrams are very useful for visualizing Observable execution. You will already know this, as we introduced marble diagrams back in Chapter 1, Diving into the Reactive Paradigm, and we’ve used them in almost all the reactive patterns we’ve implemented in this book. They are simple to understand and delightful to read. So, why not also use them in code? What you will be surprised to know is that RxJS introduced marble testing as an intuitive and clean way to test Observables.
Let’s discover what marble testing is about. We will start by explaining the syntax in the next section and then learn how we can write marble tests in our code.
Understanding the syntax
To understand the syntax, we should know about the following semantics:
Character |
Meaning |
|
This represents a special... |