我正在使用Observable.fromEvent()
, 和各种链式运算符处理鼠标悬停事件。我将如何进行单元测试?
export const bindMouseover = (link) => Observable.fromEvent(link, 'mouseover')
.filter(event => Nav.hasSubNav(event.target))
.map(event => Nav.getSubNav(event.target))
.filter(target => !Nav.elementIsVisible(target))
.subscribe((target) => {
Nav.hideElements(subNavs);
Nav.showElement(target);
});