File tree 2 files changed +24
-2
lines changed
2 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -690,9 +690,9 @@ Mocha.prototype.noHighlighting = function(enableHighlight) {
690
690
utils . deprecate (
691
691
'noHighlighting is deprecated; provide {reporterOption: {highlight: false}} to mocha.setup().'
692
692
) ;
693
- enableHighlight = enableHighlight === undefined ? true : enableHighlight ;
694
693
this . options . reporterOptions = this . options . reporterOptions || { } ;
695
- this . options . reporterOptions . highlight = enableHighlight !== true ;
694
+ this . options . reporterOptions . highlight =
695
+ enableHighlight !== undefined && enableHighlight !== true ;
696
696
return this ;
697
697
} ;
698
698
Original file line number Diff line number Diff line change @@ -300,6 +300,28 @@ describe('Mocha', function() {
300
300
) ;
301
301
} ) ;
302
302
303
+ it ( 'should set the reporterOptions.highlight to false' , function ( ) {
304
+ var mocha = new Mocha ( opts ) ;
305
+ mocha . noHighlighting ( true ) ;
306
+ expect (
307
+ mocha . options . reporterOptions ,
308
+ 'to have property' ,
309
+ 'highlight' ,
310
+ false
311
+ ) ;
312
+ } ) ;
313
+
314
+ it ( 'should set the reporterOptions.highlight to true' , function ( ) {
315
+ var mocha = new Mocha ( opts ) ;
316
+ mocha . noHighlighting ( false ) ;
317
+ expect (
318
+ mocha . options . reporterOptions ,
319
+ 'to have property' ,
320
+ 'highlight' ,
321
+ true
322
+ ) ;
323
+ } ) ;
324
+
303
325
it ( 'should be chainable' , function ( ) {
304
326
var mocha = new Mocha ( opts ) ;
305
327
expect ( mocha . noHighlighting ( ) , 'to be' , mocha ) ;
You can’t perform that action at this time.
0 commit comments