Skip to content

Commit

Permalink
Correctly skip tests when skipping in a suites before()
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Shaw committed Jan 22, 2016
1 parent b64d76c commit c97d03a
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 c97d03a

Please sign in to comment.