mbus
Version:
If Node's EventEmitter and Eve were to have a child, it might look something like this
22 lines (17 loc) • 417 B
JavaScript
var test = require('tape');
var a = require('../')('a');
var b = require('../')('', a);
test('a emits foo (no namespace prepended by b)', function(t) {
t.plan(1);
a.once('foo', function(value) {
t.equal(value, 'bar');
});
b('foo', 'bar');
});
test('parent of a emits a.foo', function(t) {
t.plan(1);
a.parent.once('a.foo', function(value) {
t.equal(value, 'bar');
});
b('foo', 'bar');
});