Jasmine can't spy on event handler?
问题 Trying to test that an event handler gets called on a clicked element with Jasmine. Have a "Pad" object that contains a DOM element "PadElement", which gets clicked. The event handler is a method on the Pad object: GRAPH.Pad = function(graphDiv, graph) { this.graph = graph; this.clickHandler = function(e) { console.log('padElement clickHandler called'); //this.graph.createVertex(e.clientX, e.clientY); }; this.padElement = GRAPH.padElement(graphDiv, this.clickHandler); } GRAPH.padElement =