I've run into trouble in the past with testing observables, so I figured I would make myself a gist to help myself remember, and to help others who find it.
Observables are rather tricky to test in general as they are made to be asynchronous and act like a stream, and up until recently it was acceptable to pass a next
, error
, and complete
callback function, but now that method is bieng deprecated in favor of Observers
. Fear not! An Observer
is just like the three callbacks rolled into a signle object, plus other fields you would like to add :).
Say that we have the following Observable
const numbersArray = from([1,2,3,4,5]);