Skip to content

armgit / mocha

Public Imported from GitHub
0

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

update pending logic to closely mimic previous behavior

Christopher Hiller4f2e4549cc04
diff --git a/lib/runner.js b/lib/runner.js
index f4e30c72..86bd4dc4 100644
--- a/lib/runner.js
+++ b/lib/runner.js
@@ -302,8 +302,13 @@ Runner.prototype.hook = function(name, fn) {
}
if (err) {
if (err instanceof Pending) {
- self.test.pending = true;
- console.log(self.test);
+ if (name === 'beforeEach' || name === 'afterEach') {
+ self.test.pending = true;
+ } else {
+ suite.tests.forEach(function(test) {
+ test.pending = true;
+ });
+ }
} else {
self.failHook(hook, err);
@@ -844,8 +849,8 @@ function filterLeaks(ok, globals) {
}
// in firefox
- // if runner runs in an iframe, this iframe's window.getInterface method not init at first
- // it is assigned in some seconds
+ // if runner runs in an iframe, this iframe's window.getInterface method
+ // not init at first it is assigned in some seconds
if (global.navigator && (/^getInterface/).test(key)) {
return false;
}