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

Function testHook

test/parallel/test-promise-hook-exceptions.js:8–18  ·  view source on GitHub ↗
(name)

Source from the content-addressed store, hash-verified

6const expected = [];
7
8function testHook(name) {
9 const hook = promiseHooks[name];
10 const error = new Error(`${name} error`);
11
12 const stop = hook(common.mustCall(() => {
13 stop();
14 throw error;
15 }));
16
17 expected.push(error);
18}
19
20process.on('uncaughtException', common.mustCall((received) => {
21 assert.strictEqual(received, expected.shift());

Callers 1

Calls 3

hookFunction · 0.50
stopFunction · 0.50
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…