Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Browser usage issues with delay option #4341

Merged
merged 3 commits into from Jul 2, 2020
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 ('delay' in opts && opts.delay === true) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can just be 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