@@ -26,8 +26,6 @@ describe('configureMocha', function() {
26
26
}
27
27
this . sandbox = sandbox . create ( )
28
28
this . spyReporter = this . sandbox . spy ( Mocha . prototype , 'reporter' )
29
- this . spyUseColors = this . sandbox . spy ( Mocha . prototype , 'useColors' )
30
- this . spyUseInlineDiffs = this . sandbox . spy ( Mocha . prototype , 'useInlineDiffs' )
31
29
this . spyEnableTimeouts = this . sandbox . spy ( Mocha . prototype , 'enableTimeouts' )
32
30
this . spyGrep = this . sandbox . spy ( Mocha . prototype , 'grep' )
33
31
this . spyGrowl = this . sandbox . spy ( Mocha . prototype , 'growl' )
@@ -60,27 +58,36 @@ describe('configureMocha', function() {
60
58
)
61
59
} )
62
60
63
- it ( 'should call useColors()' , function ( ) {
64
- configureMocha ( {
65
- ...this . options
61
+ it ( 'should set color' , function ( ) {
62
+ var mocha = configureMocha ( {
63
+ ...this . options ,
64
+ colors : undefined
66
65
} )
67
66
68
- assert . isTrue ( this . spyUseColors . called , 'useColors() should be called' )
69
- assert . isTrue ( this . spyUseColors . calledWith ( this . options . colors ) )
67
+ assert . isFalse ( mocha . options . color )
68
+
69
+ mocha = configureMocha ( {
70
+ ...this . options ,
71
+ colors : true
72
+ } )
73
+
74
+ assert . isTrue ( mocha . options . color )
70
75
} )
71
76
72
- it ( 'should call useInlineDiffs()' , function ( ) {
73
- configureMocha ( {
74
- ...this . options
77
+ it ( 'should set inlineDiffs' , function ( ) {
78
+ var mocha = configureMocha ( {
79
+ ...this . options ,
80
+ useInlineDiffs : undefined
75
81
} )
76
82
77
- assert . isTrue (
78
- this . spyUseInlineDiffs . called ,
79
- 'useInlineDiffs() should be called'
80
- )
81
- assert . isTrue (
82
- this . spyUseInlineDiffs . calledWith ( this . options . useInlineDiffs )
83
- )
83
+ assert . isFalse ( mocha . options . inlineDiffs )
84
+
85
+ mocha = configureMocha ( {
86
+ ...this . options ,
87
+ useInlineDiffs : true
88
+ } )
89
+
90
+ assert . isTrue ( mocha . options . inlineDiffs )
84
91
} )
85
92
86
93
it ( 'should call enableTimeouts()' , function ( ) {
0 commit comments