Skip to content

Commit

Permalink
feat(suite): allow calling hook methods
Browse files Browse the repository at this point in the history
  • Loading branch information
perrin4869 committed Oct 14, 2024
1 parent 97af04f commit e599ff1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/suite.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ Suite.prototype.beforeAll = function (title, fn) {
var hook = this._createHook(title, fn);
this._beforeAll.push(hook);
this.emit(constants.EVENT_SUITE_ADD_HOOK_BEFORE_ALL, hook);
return this;
return hook;
};

/**
Expand All @@ -281,7 +281,7 @@ Suite.prototype.afterAll = function (title, fn) {
var hook = this._createHook(title, fn);
this._afterAll.push(hook);
this.emit(constants.EVENT_SUITE_ADD_HOOK_AFTER_ALL, hook);
return this;
return hook;
};

/**
Expand All @@ -305,7 +305,7 @@ Suite.prototype.beforeEach = function (title, fn) {
var hook = this._createHook(title, fn);
this._beforeEach.push(hook);
this.emit(constants.EVENT_SUITE_ADD_HOOK_BEFORE_EACH, hook);
return this;
return hook;
};

/**
Expand All @@ -329,7 +329,7 @@ Suite.prototype.afterEach = function (title, fn) {
var hook = this._createHook(title, fn);
this._afterEach.push(hook);
this.emit(constants.EVENT_SUITE_ADD_HOOK_AFTER_EACH, hook);
return this;
return hook;
};

/**
Expand Down

0 comments on commit e599ff1

Please sign in to comment.