Skip to content

armgit / mocha

Public Imported from GitHub
0

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

modify suite retval warning to be more useful

Christopher Hillerc19832985d08
diff --git a/lib/interfaces/common.js b/lib/interfaces/common.js
index 1656ce2a..4c9c4303 100644
--- a/lib/interfaces/common.js
+++ b/lib/interfaces/common.js
@@ -141,10 +141,11 @@ module.exports = function(suites, context, mocha) {
var result = opts.fn.call(suite);
if (typeof result !== 'undefined') {
utils.deprecate(
- 'Deprecation Warning: Suites do not support a return value;' +
- opts.title +
- ' returned :' +
- result
+ 'Suites ignore return values. Suite "' +
+ opts.fullTitle() +
+ '" in ' +
+ opts.file +
+ ' returned a value; this may be a bug in your test code'
);
}
suites.shift();