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

Conversation

craigtaub
Copy link
Contributor

@craigtaub craigtaub commented Jun 22, 2020

There seem to be 2 issues currently with the delay option in the browser usage.

  1. setting mocha.setup({delay: false}) actually enables the delay - this is because delay does not work with an argument.
  2. calling ui before delay does not apply the delay (see issue).
// this does not work
mocha.setup({ui: 'bdd', delay: true});

This fix runs delay flag separately to the others.

Alternative designs

Could update delay to work with an argument. Thought it was slightly better to apply a fix just to the browser-based code. Also that would not have been enough to fix the issue with the ordering.

Could not see a way to get it to work like the CLI as mocha handles options differently for cli + browser (e.g. whats available for the constructor).

Possible Drawbacks

Currently no HTML reporter tests so is currently not covered.
Looking for recommendations.

Applicable issues

#1799

@craigtaub craigtaub added semver-patch implementation requires increase of "patch" version number; "bug fixes" area: browser browser-specific labels Jun 22, 2020
@coveralls
Copy link

coveralls commented Jun 22, 2020

Coverage Status

Coverage remained the same at 93.766% when pulling a53de98 on craigtaub/issue/1799-browser-delay-issue into a1d3984 on master.

@craigtaub craigtaub requested a review from boneskull June 22, 2020 18:13
browser-entry.js Outdated
if (Object.prototype.hasOwnProperty.call(opts, opt)) {
this[opt](opts[opt]);
}
if ('delay' in opts && opts.delay === true) {
Copy link
Contributor

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)

@craigtaub craigtaub merged commit f77aa7a into master Jul 2, 2020
@craigtaub craigtaub deleted the craigtaub/issue/1799-browser-delay-issue branch July 2, 2020 10:17
@craigtaub craigtaub added this to the next milestone Jul 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: browser browser-specific semver-patch implementation requires increase of "patch" version number; "bug fixes"
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants