mbus
Version:
If Node's EventEmitter and Eve were to have a child, it might look something like this
21 lines (16 loc) • 409 B
JavaScript
var test = require('tape');
var bus = require('../')('test');
test('wildcard matches work', function(t) {
t.plan(1);
bus.once('foo.*', function(data) {
t.equal(data, 'bar');
});
bus('foo.test', 'bar');
});
test('wildcard matches only work on a part boundary', function(t) {
t.plan(1);
bus.once('foo.*', function() {
t.fail('should not have triggered');
});
bus('fool', 'bar');
});