Lines Matching refs:ee
15 const ee = new EventEmitter();
18 ee.emit('myevent', 42);
21 const [value] = await once(ee, 'myevent');
23 strictEqual(ee.listenerCount('error'), 0);
24 strictEqual(ee.listenerCount('myevent'), 0);
28 const ee = new EventEmitter();
31 ee.emit('myevent', 42);
34 const [value] = await once(ee, 'myevent', null);
40 const ee = new EventEmitter();
43 ee.emit('myevent', 42, 24);
46 const value = await once(ee, 'myevent');
51 const ee = new EventEmitter();
56 ee.emit('error', expected);
60 await once(ee, 'myevent');
65 strictEqual(ee.listenerCount('error'), 0);
66 strictEqual(ee.listenerCount('myevent'), 0);
70 const ee = new EventEmitter();
77 ee.emit('error', expected);
81 const promise = once(ee, 'myevent', { signal });
82 strictEqual(ee.listenerCount('error'), 1);
90 strictEqual(ee.listenerCount('error'), 0);
91 strictEqual(ee.listenerCount('myevent'), 0);
96 const ee = new EventEmitter();
101 ee.emit('error', expected);
102 ee.emit('myevent', 42, 24);
106 await once(ee, 'myevent');
112 strictEqual(ee.listenerCount('error'), 0);
113 strictEqual(ee.listenerCount('myevent'), 0);
117 const ee = new EventEmitter();
121 ee.emit('error', expected);
124 const promise = once(ee, 'error');
125 strictEqual(ee.listenerCount('error'), 1);
128 strictEqual(ee.listenerCount('error'), 0);
129 strictEqual(ee.listenerCount('myevent'), 0);
161 const ee = new EventEmitter();
162 ee.addEventListener = fail;
163 ee.removeAllListeners = fail;
164 process.nextTick(() => ee.emit('foo'));
165 await once(ee, 'foo');
169 const ee = new EventEmitter();
170 ee.on('error', common.mustNotCall());
174 return rejects(once(ee, 'foo', { signal }), {
179 return rejects(once(ee, 'foo', { signal: abortedSignal }), {
185 const ee = new EventEmitter();
187 ee.on('error', common.mustNotCall());
188 const r = rejects(once(ee, 'foo', { signal: ac.signal }), {
196 const ee = new EventEmitter();
199 ee.emit('foo');
202 const promise = once(ee, 'foo', { signal: ac.signal });
209 const ee = new EventEmitter();
214 await once(ee, 'test', { signal: ac.signal });
216 strictEqual(ee.listeners('test').length, 0);
217 strictEqual(ee.listeners('error').length, 0);