* Executes hooks.
()
| 120 | * Executes hooks. |
| 121 | */ |
| 122 | async runHooks() { |
| 123 | // For workers parent process we only need plugins/hooks. |
| 124 | // Core listeners are executed inside worker threads. |
| 125 | if (!this.opts?.skipDefaultListeners) { |
| 126 | const listenerModules = [ |
| 127 | './listener/store.js', |
| 128 | './listener/steps.js', |
| 129 | './listener/config.js', |
| 130 | './listener/result.js', |
| 131 | './listener/helpers.js', |
| 132 | './listener/pageobjects.js', |
| 133 | './listener/globalTimeout.js', |
| 134 | './listener/globalRetry.js', |
| 135 | './listener/retryEnhancer.js', |
| 136 | './listener/exit.js', |
| 137 | './listener/emptyRun.js', |
| 138 | ] |
| 139 | |
| 140 | for (const modulePath of listenerModules) { |
| 141 | const resolvedPath = resolveImportModulePath(modulePath) |
| 142 | const module = await import(resolvedPath) |
| 143 | runHook(module.default || module) |
| 144 | } |
| 145 | } |
| 146 | |
| 147 | // custom hooks (previous iteration of plugins) |
| 148 | this.config.hooks.forEach(hook => runHook(hook)) |
| 149 | } |
| 150 | |
| 151 | /** |
| 152 | * Executes bootstrap. |
no test coverage detected