| 157 | } |
| 158 | |
| 159 | async function abortSignalBefore() { |
| 160 | const ee = new EventEmitter(); |
| 161 | ee.on('error', common.mustNotCall()); |
| 162 | const abortedSignal = AbortSignal.abort(); |
| 163 | |
| 164 | await Promise.all([1, {}, 'hi', null, false].map((signal) => { |
| 165 | return assert.rejects(once(ee, 'foo', { signal }), { |
| 166 | code: 'ERR_INVALID_ARG_TYPE', |
| 167 | }); |
| 168 | })); |
| 169 | |
| 170 | return assert.rejects(once(ee, 'foo', { signal: abortedSignal }), { |
| 171 | name: 'AbortError', |
| 172 | }); |
| 173 | } |
| 174 | |
| 175 | async function abortSignalAfter() { |
| 176 | const ee = new EventEmitter(); |