(hook, args)
| 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(); |
no test coverage detected