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

Function testRequestError

test/parallel/test-inspector-network-fetch.js:176–191  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

174}
175
176async function testRequestError(url) {
177 const requestWillBeSentFuture = once(session, 'Network.requestWillBeSent')
178 .then(([event]) => verifyRequestWillBeSent(event, { url, method: 'GET' }));
179 session.on('Network.responseReceived', common.mustNotCall());
180 session.on('Network.loadingFinished', common.mustNotCall());
181
182 const loadingFailedFuture = once(session, 'Network.loadingFailed')
183 .then(([event]) => verifyLoadingFailed(event));
184
185 fetch(url, {
186 headers: requestHeaders,
187 }).catch(common.mustCall());
188
189 await requestWillBeSentFuture;
190 await loadingFailedFuture;
191}
192
193const testNetworkInspection = async () => {
194 // HTTP

Callers 1

testNetworkInspectionFunction · 0.85

Calls 6

fetchFunction · 0.85
onceFunction · 0.70
verifyRequestWillBeSentFunction · 0.70
verifyLoadingFailedFunction · 0.70
thenMethod · 0.45
onMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…