RxJS is a set of APIs that unifies the way you interact with collections and events.
The main actors are Observables and Observers, but the full power of the library is the rich set of operators and schedulers that you can combine to achieve really complex data processing and orchestration in a very expressive and declarative way.
Observables push values to subscribers.
You can convert different data types to Observables.
There are a few shortcut operators to create common special Observables.
To stream values over time you can use schedulers.
Finally, you can unsubscribe from an Observable to stop recibing data.
That just scratches the surface of what can be achieved with Observables.
To find out more about RxJS check the RxJS github repo.
It looks like you can mock jQuery selector api calls by spying on
$.fn.init. In the case of #ID selectors it works different and
document.getElementById() is used.
I have proof:
When you need to test what is happening inside a constructor it’s not obvious how to do it, because it looks like you can’t spy the SUT when you haven’t even created an instance.
When using Jasmine’s spy.and.callFake, the function execution happens within the spied instance.
This fact is not documented elsewhere but it’s interesting anyway, because it allows some neat tricks.
Some tests to illustrate the scenario:
When you are inspecting the DOM in Chrome Dev-tools there’s a yellowish tooltip that displays information about the currently hovered HTML node.
To get rid of it just press CMD (OSX) or CTRL (WIN) while hovering the Element’s panel in dev-tools.
Happy inspecting :)