Skip to content

armgit / mocha

Public Imported from GitHub
0

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

Added merging to bdd / exports interfaces

Tj Holowaychuk24c1246e5a62
diff --git a/lib/interfaces/exports.js b/lib/interfaces/exports.js
index f90e87d3..b22607e0 100644
--- a/lib/interfaces/exports.js
+++ b/lib/interfaces/exports.js
@@ -50,7 +50,7 @@ module.exports = function(suite){
suites[0].addTest(new Test(key, fn));
}
} else {
- suites[0].addSuite(suite = new Suite(key));
+ var suite = Suite.create(suites[0], key);
suites.unshift(suite);
visit(obj[key]);
suites.shift();
diff --git a/lib/interfaces/tdd.js b/lib/interfaces/tdd.js
index 5dfd8bc1..2c5b9daa 100644
--- a/lib/interfaces/tdd.js
+++ b/lib/interfaces/tdd.js
@@ -51,8 +51,7 @@ module.exports = function(suite){
*/
context.suite = function(title, fn){
- var suite = new Suite(title);
- suites[0].addSuite(suite);
+ var suite = Suite.create(suites[0], title);
suites.unshift(suite);
fn();
suites.shift();