Beispiel #1
0
 'test setDefaultEmitter': function () {
     var handler = function () {},
         data = {};
     eventbox.subscribe('topic', handler);
     eventbox.setDefaultEmitter(function (h, d) {
         assert(h === handler,
             'The subscribed handler is !== as invoked handler');
         assert(d === data,
             'The data provided to publish is !== from the data passed to the emitting function');
     });
     eventbox.publish('topic', data);
 }
Beispiel #2
0
 afterEach: function () {
     eventbox.unsubscribeAll();
     eventbox.setDefaultEmitter();
 },