Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('doesn\'t proxy to framebus after calling', function () {
this.bus.teardown();
this.bus.on(this.event, this.handler);
expect(framebus.on).not.to.be.called;
this.bus.off(this.event, this.handler);
expect(framebus.off).not.to.be.called;
this.bus.emit(this.event);
expect(framebus.emit).not.to.be.called;
});
});
it('proxies to Framebus\'s off', function () {
this.bus.off(this.event, this.handler);
expect(framebus.off).to.be.calledWith('braintree:foo:' + this.event, this.handler);
});
BraintreeBus.prototype._offDirect = function (eventName) {
var args = Array.prototype.slice.call(arguments);
if (this._isDestroyed) { return; }
args[0] = this._namespaceEvent(eventName);
this._log('off', args);
bus.off.apply(bus, args);
};