Testing transducers

When using transducers you can decouple the logic to transform your data from the source of your data; this way you can create tests for each one of your transducers without having to add an observable.

To test transducers we will use the exact same tools we used to test observables so far; the difference is that we can test the logic of the transducers using any iterable source of data such as an array or an observable.

Since observables are asynchronous data structure by nature, every time we want to test an observable, or to test the transformations applied to an observable, we need to create asynchronous tests. As transducers work independently of the current source of data we can use arrays to its behavior; using ...

Get Mastering Reactive JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.