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

🚀 Feature: Soft-deprecate noHighlighting #3701

Open
boneskull opened this issue Jan 29, 2019 · 2 comments
Open

🚀 Feature: Soft-deprecate noHighlighting #3701

boneskull opened this issue Jan 29, 2019 · 2 comments
Labels
area: browser browser-specific area: usability concerning user experience or interface status: accepting prs Mocha can use your help with this one!

Comments

@boneskull
Copy link
Contributor

boneskull commented Jan 29, 2019

noHighlighting is a browser-only option can supply which disables syntax highlighting.

It should probably be replaced with a reporter option (though open to debate!), since it's unique to the html reporter. This should be a boolean option which defaults to true.

If a user supplies {noHighlighting: true} to mocha.setup() or calls mocha.noHighlighting() in the browser, we should print a deprecation message along the lines of "noHighlighting is deprecated; provide {reporterOption: {highlight: false}} to mocha.setup().

This is what needs to be done:

  • The former case can be caught in the browser setup method; see deprecation notices in the Mocha constructor for examples.
  • The latter case can be addressed by calling utils.deprecate(...) within Mocha#noHighlighting.
  • The html reporter's constructor should accept a reporterOptions object, which may be undefined, and may have a boolean highlight property. If the property is anything other than explicitly false, default to true
  • The reporter's constructor should execute Mocha.utils.highlightTags('code') when the end event is emitted by the runner property; use the check for document found here and the value of highlight prop passed in reporterOptions.
  • Remove those checks from the callback in browser-entry.js.
  • Please add unit tests which assert the new behavior in test/unit/mocha.spec.js.
  • Update documentation (docs/index.md) about the deprecation and new behavior.
@boneskull boneskull added area: browser browser-specific status: accepting prs Mocha can use your help with this one! area: usability concerning user experience or interface good first issue new contributors should look here! labels Jan 29, 2019
@boneskull
Copy link
Contributor Author

Fair warning: this is labeled good-first-issue with some hesitation; it's not a nontrivial task.

Mia-jeong added a commit to Mia-jeong/mocha that referenced this issue Oct 3, 2019
…light code form browser-entry.js to html.js
@Mia-jeong
Copy link
Contributor

Mia-jeong commented Oct 6, 2019

Hi :) I just made a PR about it. While I was working on it I found out a bug related to noHighlighting and I referred it to the PR as well. I would like to thank you that I was able to do it because you wrote everything in very detail.

@JoshuaKGoldberg JoshuaKGoldberg removed the good first issue new contributors should look here! label Dec 27, 2023
@JoshuaKGoldberg JoshuaKGoldberg changed the title soft-deprecate noHighlighting 🚀 Feature: Soft-deprecate noHighlighting Dec 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: browser browser-specific area: usability concerning user experience or interface status: accepting prs Mocha can use your help with this one!
Projects
None yet
Development

No branches or pull requests

3 participants