Skip to content

armgit / mocha

Public Imported from GitHub
0

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

Add filenames to Suite objects

gaye55f01bcb3713
diff --git a/lib/interfaces/bdd.js b/lib/interfaces/bdd.js
index cca6155b..ebf6f0f4 100644
--- a/lib/interfaces/bdd.js
+++ b/lib/interfaces/bdd.js
@@ -69,6 +69,7 @@ module.exports = function(suite){
context.describe = context.context = function(title, fn){
var suite = Suite.create(suites[0], title);
+ suite.file = file;
suites.unshift(suite);
fn.call(suite);
suites.shift();
diff --git a/lib/interfaces/qunit.js b/lib/interfaces/qunit.js
index 0c02977a..02d50070 100644
--- a/lib/interfaces/qunit.js
+++ b/lib/interfaces/qunit.js
@@ -76,6 +76,7 @@ module.exports = function(suite){
context.suite = function(title){
if (suites.length > 1) suites.shift();
var suite = Suite.create(suites[0], title);
+ suite.file = file;
suites.unshift(suite);
return suite;
};
diff --git a/lib/interfaces/tdd.js b/lib/interfaces/tdd.js
index 3df2508b..6d0c3d6e 100644
--- a/lib/interfaces/tdd.js
+++ b/lib/interfaces/tdd.js
@@ -77,6 +77,7 @@ module.exports = function(suite){
context.suite = function(title, fn){
var suite = Suite.create(suites[0], title);
+ suite.file = file;
suites.unshift(suite);
fn.call(suite);
suites.shift();