Skip to content

armgit / mocha

Public Imported from GitHub
0

☕️ Classic, reliable, trusted test framework for Node.js and the browser

wip Fix suite being marked as pending when beforeEach skips

David da Silva22dbad7c8d4e
diff --git a/lib/runner.js b/lib/runner.js
index ba4d7df9..f4e30c72 100644
--- a/lib/runner.js
+++ b/lib/runner.js
@@ -302,7 +302,8 @@ Runner.prototype.hook = function(name, fn) {
}
if (err) {
if (err instanceof Pending) {
- suite.pending = true;
+ self.test.pending = true;
+ console.log(self.test);
} else {
self.failHook(hook, err);
@@ -516,7 +517,7 @@ Runner.prototype.runTests = function(suite, fn) {
// execute test and hook(s)
self.emit('test', self.test = test);
self.hookDown('beforeEach', function(err, errSuite) {
- if (suite.isPending()) {
+ if (test.isPending()) {
self.emit('pending', test);
self.emit('test end', test);
return next();