diff --git a/lib/mocha.js b/lib/mocha.js index 06b626b631..16216ec3bf 100644 --- a/lib/mocha.js +++ b/lib/mocha.js @@ -690,9 +690,9 @@ Mocha.prototype.noHighlighting = function(enableHighlight) { utils.deprecate( 'noHighlighting is deprecated; provide {reporterOption: {highlight: false}} to mocha.setup().' ); + enableHighlight = enableHighlight === undefined ? true : enableHighlight; this.options.reporterOptions = this.options.reporterOptions || {}; - this.options.reporterOptions.highlight = - enableHighlight !== undefined && enableHighlight !== true; + this.options.reporterOptions.highlight = enableHighlight !== true; return this; };