Skip to content

Commit

Permalink
add actionable error message for TimeoutError in hooks. (#4053)
Browse files Browse the repository at this point in the history
* added a help message in case when async hook timesout.

* updated help message

Co-authored-by: Priyansh Garg <priyanshgarg30@gmail.com>

---------

Co-authored-by: Priyansh Garg <priyanshgarg30@gmail.com>
  • Loading branch information
dikwickley and garg3133 committed Feb 26, 2024
1 parent c990fc6 commit ae23267
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/testsuite/hooks/_basehook.js
Expand Up @@ -62,6 +62,7 @@ class BaseHook {
return new Promise((resolve, reject) => {
try {
const timedCallback = this.createCallbackWrapper(resolve, reject, err => {
err.help = ['You can increase the hooks timeout by setting "asyncHookTimeout" in the globals config to the required value.'];
err.skipTestCases = this.skipTestcasesOnError;
runnableDone && runnableDone(err);
reject(err);
Expand Down Expand Up @@ -151,7 +152,7 @@ class BaseHook {
* @return {TimedCallback}
*/
createCallbackWrapper(resolve, reject, timeoutExpired) {
let timedCallback = new TimedCallback(function doneCallback(err) {
const timedCallback = new TimedCallback(function doneCallback(err) {
if (Utils.isErrorObject(err)) {
return reject(err);
}
Expand Down

0 comments on commit ae23267

Please sign in to comment.