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

Function agentAsParam

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

Source from the content-addressed store, hash-verified

50
51
52 async function agentAsParam() {
53 const ac = new AbortController();
54 const { signal } = ac;
55 const request = https.get({
56 port: server.address().port,
57 path: '/hello',
58 agent: agent,
59 signal,
60 });
61 assert.strictEqual(listenerCount(signal, 'abort'), 1);
62 ac.abort();
63 const [err] = await once(request, 'error');
64 assert.strictEqual(err.name, 'AbortError');
65 }
66
67 async function agentAsParamPreAbort() {
68 const ac = new AbortController();

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…