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

Function agentAsParamPreAbort

test/parallel/test-https-agent-abort-controller.js:67–80  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

65 }
66
67 async function agentAsParamPreAbort() {
68 const ac = new AbortController();
69 const { signal } = ac;
70 ac.abort();
71 const request = https.get({
72 port: server.address().port,
73 path: '/hello',
74 agent: agent,
75 signal,
76 });
77 assert.strictEqual(listenerCount(signal, 'abort'), 0);
78 const [err] = await once(request, 'error');
79 assert.strictEqual(err.name, 'AbortError');
80 }
81
82 await postCreateConnection();
83 await preCreateConnection();

Calls 5

abortMethod · 0.95
listenerCountFunction · 0.85
onceFunction · 0.70
getMethod · 0.65
addressMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…