Skip to content

armgit / mocha

Public Imported from GitHub
0

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

[Fix] Exclude not own properties when looping on options

Anis Safine8a607872c1ea
diff --git a/mocha.js b/mocha.js
old mode 100644
new mode 100755
index c6b62d37..cffddcbc
--- a/mocha.js
+++ b/mocha.js
@@ -6518,7 +6518,11 @@ mocha.ui = function(ui){
mocha.setup = function(opts){
if ('string' == typeof opts) opts = { ui: opts };
- for (var opt in opts) this[opt](opts[opt]);
+ for (var opt in opts) {
+ if (opts.hasOwnProperty(opt)) {
+ this[opt](opts[opt]);
+ }
+ }
return this;
};