Skip to content

Commit

Permalink
Merge pull request #1945 from ryanshawty/master
Browse files Browse the repository at this point in the history
Correctly skip tests when skipping in a suites before()
  • Loading branch information
danielstjules committed Jan 26, 2016
2 parents b64d76c + c97d03a commit 8522755
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -507,8 +507,12 @@ Runner.prototype.runTests = function(suite, fn) {
return;
}

function parentPending(suite) {
return suite.pending || (suite.parent && parentPending(suite.parent));
}

// pending
if (test.pending) {
if (test.pending || parentPending(test.parent)) {
self.emit('pending', test);
self.emit('test end', test);
return next();
Expand Down

0 comments on commit 8522755

Please sign in to comment.