()
| 103 | } |
| 104 | |
| 105 | async function throwInLoop() { |
| 106 | const ee = new EventEmitter(); |
| 107 | const _err = new Error('kaboom'); |
| 108 | |
| 109 | process.nextTick(() => { |
| 110 | ee.emit('foo', 42); |
| 111 | }); |
| 112 | |
| 113 | try { |
| 114 | for await (const event of on(ee, 'foo')) { |
| 115 | assert.deepStrictEqual(event, [42]); |
| 116 | throw _err; |
| 117 | } |
| 118 | } catch (err) { |
| 119 | assert.strictEqual(err, _err); |
| 120 | } |
| 121 | |
| 122 | assert.strictEqual(ee.listenerCount('foo'), 0); |
| 123 | assert.strictEqual(ee.listenerCount('error'), 0); |
| 124 | } |
| 125 | |
| 126 | async function next() { |
| 127 | const ee = new EventEmitter(); |
nothing calls this directly
no test coverage detected
searching dependent graphs…