3 var ee = require('../');
5 module.exports = function (t) {
9 a(t(true), false, "Primitive");
10 a(t({ events: [] }), false, "Other object");
11 a(t(x = ee()), false, "Emitter: empty");
13 x.on('test', y = function () {});
14 a(t(x), true, "Emitter: full");
16 a(t(x), false, "Emitter: empty but touched");
17 x.once('test', y = function () {});
18 a(t(x), true, "Emitter: full: Once");
20 a(t(x), false, "Emitter: empty but touched by once");
22 Specific: function (a) {
23 a(t(true, 'test'), false, "Primitive");
24 a(t({ events: [] }, 'test'), false, "Other object");
25 a(t(x = ee(), 'test'), false, "Emitter: empty");
27 x.on('test', y = function () {});
28 a(t(x, 'test'), true, "Emitter: full");
29 a(t(x, 'foo'), false, "Emitter: full, other event");
31 a(t(x, 'test'), false, "Emitter: empty but touched");
32 a(t(x, 'foo'), false, "Emitter: empty but touched, other event");
34 x.once('test', y = function () {});
35 a(t(x, 'test'), true, "Emitter: full: Once");
36 a(t(x, 'foo'), false, "Emitter: full: Once, other event");
38 a(t(x, 'test'), false, "Emitter: empty but touched by once");
39 a(t(x, 'foo'), false, "Emitter: empty but touched by once, other event");