diff --git a/lib/runner.js b/lib/runner.js index 6952efa92c..90afe3998f 100644 --- a/lib/runner.js +++ b/lib/runner.js @@ -379,6 +379,13 @@ Runner.prototype.hook = function(name, fn) { if (err instanceof Pending) { if (name === HOOK_TYPE_BEFORE_EACH || name === HOOK_TYPE_AFTER_EACH) { self.test.pending = true; + if (name === HOOK_TYPE_AFTER_EACH) { + utils.deprecate( + 'this.skip() in "' + + HOOK_TYPE_AFTER_EACH + + '()" hooks is DEPRECATED and will be removed from a future version of Mocha.' + ); + } } else { suite.tests.forEach(function(test) { test.pending = true; @@ -388,6 +395,13 @@ Runner.prototype.hook = function(name, fn) { }); // a pending hook won't be executed twice. hook.pending = true; + if (name === HOOK_TYPE_AFTER_ALL) { + utils.deprecate( + 'this.skip() in "' + + HOOK_TYPE_AFTER_ALL + + '()" hooks is DEPRECATED and will be removed from a future version of Mocha.' + ); + } } } else { self.failHook(hook, err);