(hooks, lifecycle, hookId)
| 266 | } |
| 267 | |
| 268 | function getHookCommandById(hooks, lifecycle, hookId) { |
| 269 | const hookGroup = hooks.hooks[lifecycle]?.find(entry => entry.id === hookId); |
| 270 | |
| 271 | assert.ok(hookGroup, `Expected ${lifecycle} hook with id "${hookId}"`); |
| 272 | assert.ok(hookGroup.hooks?.[0]?.command, `Expected ${lifecycle} hook command for id "${hookId}"`); |
| 273 | return hookGroup.hooks[0].command; |
| 274 | } |
| 275 | |
| 276 | // Test suite |
| 277 | async function runTests() { |