Skip to content

Commit

Permalink
update baseHook to handle hook done function inside command callback (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
gravityvi authored Mar 24, 2023
1 parent c7ac9c3 commit 72ec9b5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
9 changes: 3 additions & 6 deletions lib/testsuite/hooks/_basehook.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,9 @@ class BaseHook {
}

if (this.context.queue && this.context.queue.inProgress) {
process.nextTick(() => {

this.context.queue.once('queue:finished', _ => {
runnableDone && runnableDone(result);
doneFn(result);
});
this.context.queue.once('queue:finished', _ => {
runnableDone && runnableDone(result);
doneFn(result);
});
} else {
runnableDone && runnableDone(result);
Expand Down
3 changes: 2 additions & 1 deletion test/sampletests/beforewithcommand/commandInsideBefore.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ module.exports = {
client.end();
},

afterEach: function(client) {
afterEach: function(client, cb) {
client.globals.calls++;
client.end(cb);
},

after: function(client) {
Expand Down

0 comments on commit 72ec9b5

Please sign in to comment.