Skip to content

armgit / mocha

Public Imported from GitHub
0

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

add `this.timeout(ms)` as Suite#timeout(ms). Closes #599

TJ Holowaychuk3f819801f72f
diff --git a/lib/interfaces/bdd.js b/lib/interfaces/bdd.js
index 5164e583..b46d1697 100644
--- a/lib/interfaces/bdd.js
+++ b/lib/interfaces/bdd.js
@@ -69,7 +69,7 @@ module.exports = function(suite){
context.describe = context.context = function(title, fn){
var suite = Suite.create(suites[0], title);
suites.unshift(suite);
- fn();
+ fn.call(suite);
suites.shift();
return suite;
};
@@ -84,7 +84,7 @@ module.exports = function(suite){
var suite = Suite.create(suites[0], title);
suite.pending = true;
suites.unshift(suite);
- fn();
+ fn.call(suite);
suites.shift();
};
diff --git a/lib/interfaces/tdd.js b/lib/interfaces/tdd.js
index a73ad777..0a17cd27 100644
--- a/lib/interfaces/tdd.js
+++ b/lib/interfaces/tdd.js
@@ -77,7 +77,7 @@ module.exports = function(suite){
context.suite = function(title, fn){
var suite = Suite.create(suites[0], title);
suites.unshift(suite);
- fn();
+ fn.call(suite);
suites.shift();
return suite;
};