Skip to content

Commit

Permalink
Browser usage issues with delay option (#4341)
Browse files Browse the repository at this point in the history
* Prioritise delay option

* lint fix

* Improve conditional
  • Loading branch information
craigtaub committed Jul 2, 2020
1 parent 7540efb commit f77aa7a
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions browser-entry.js
Expand Up @@ -139,11 +139,19 @@ mocha.setup = function(opts) {
if (typeof opts === 'string') {
opts = {ui: opts};
}
for (var opt in opts) {
if (Object.prototype.hasOwnProperty.call(opts, opt)) {
this[opt](opts[opt]);
}
if (opts.delay === true) {
this.delay();
}
var self = this;
Object.keys(opts)
.filter(function(opt) {
return opt !== 'delay';
})
.forEach(function(opt) {
if (Object.prototype.hasOwnProperty.call(opts, opt)) {
self[opt](opts[opt]);
}
});
return this;
};

Expand Down

0 comments on commit f77aa7a

Please sign in to comment.