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

Function test

deps/v8/test/mjsunit/async-stack-traces-promise-all-settled.js:20–33  ·  view source on GitHub ↗
(f)

Source from the content-addressed store, hash-verified

18 }
19
20 async function test(f) {
21 const results = await f();
22 results.forEach((result, i) => {
23 if (result.status === 'rejected') {
24 const error = result.reason;
25 assertInstanceof(error, Error);
26 const stackRegexp = new RegExp("Error.+at thrower.+at " +
27 `async Promise.allSettled \\(index ${ i }\\)` +
28 ".+ at async driver.+at async test",
29 "ms")
30 assertMatches(stackRegexp, error.stack);
31 }
32 });
33 }
34
35 assertPromiseResult((async () => {
36 %PrepareFunctionForOptimization(thrower);

Calls 3

assertInstanceofFunction · 0.85
fFunction · 0.70
forEachMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…