UNPKG

mbus

Version:

If Node's EventEmitter and Eve were to have a child, it might look something like this

20 lines (16 loc) 386 B
var test = require('tape'); var bus = require('../')('test'); test('bus emits simple events', function(t) { t.plan(1); bus.once('foo', function(data) { t.equal(data, 'bar'); }); bus('foo', 'bar'); }) test('bus namespaces events correctly', function(t) { t.plan(1); bus.parent.once('test.foo', function(data) { t.equal(data, 'bar'); }); bus('foo', 'bar'); });