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

Method runHook

lib/internal/test_runner/test.js:1263–1279  ·  view source on GitHub ↗
(hook, args)

Source from the content-addressed store, hash-verified

1261 }
1262
1263 async runHook(hook, args) {
1264 validateOneOf(hook, 'hook name', kHookNames);
1265 try {
1266 const hooks = this.hooks[hook];
1267 for (let i = 0; i < hooks.length; ++i) {
1268 const hook = hooks[i];
1269 await hook.run(args);
1270 if (hook.error) {
1271 throw hook.error;
1272 }
1273 }
1274 } catch (err) {
1275 const error = new ERR_TEST_FAILURE(`failed running ${hook} hook`, kHookFailure);
1276 error.cause = isTestFailureError(err) ? err.cause : err;
1277 throw error;
1278 }
1279 }
1280
1281 async filteredRun() {
1282 this.pass();

Callers 3

afterMethod · 0.95
runMethod · 0.80
runMethod · 0.80

Calls 2

isTestFailureErrorFunction · 0.85
runMethod · 0.45

Tested by

no test coverage detected