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

Function hook

lib/internal/test_runner/harness.js:423–434  ·  view source on GitHub ↗
(hook)

Source from the content-addressed store, hash-verified

421}
422
423function hook(hook) {
424 return (fn, options) => {
425 const parent = testResources.get(executionAsyncId()) || lazyBootstrapRoot();
426 parent.createHook(hook, fn, {
427 __proto__: null,
428 ...options,
429 parent,
430 hookType: hook,
431 loc: getCallerLocation(),
432 });
433 };
434}
435
436function getTestContext() {
437 const test = testResources.get(executionAsyncId());

Callers 3

harness.jsFile · 0.70
makeRunHookFunction · 0.50
nextHookFactoryFunction · 0.50

Calls 4

executionAsyncIdFunction · 0.85
lazyBootstrapRootFunction · 0.85
createHookMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…