MCPcopy Index your code
hub / github.com/nodejs/node / abortSignalBefore

Function abortSignalBefore

test/parallel/test-events-once.js:159–173  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

157}
158
159async 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
175async function abortSignalAfter() {
176 const ee = new EventEmitter();

Callers 1

Calls 5

allMethod · 0.80
onceFunction · 0.70
abortMethod · 0.65
mapMethod · 0.65
onMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…