@@ -39,6 +39,7 @@ var sinonChai = require('sinon-chai');
39
39
chai . use ( sinonChai ) ;
40
40
var should = chai . should ( ) ;
41
41
var expect = chai . expect ;
42
+ var os = require ( 'os' ) ;
42
43
var reporterRewire = rewire ( '../index.js' ) ;
43
44
var SpecReporter = require ( '../index.js' ) [ 'reporter:spec' ] ;
44
45
@@ -129,15 +130,28 @@ describe('SpecReporter', function () {
129
130
} ) ;
130
131
131
132
it ( 'should set the BaseReporter function\'s colors' , function ( ) {
132
- newSpecReporter . SPEC_FAILURE . should . equal ( ansiColors . red + '%s %s FAILED' + ansiColors . reset + '\n' ) ;
133
- newSpecReporter . SPEC_SLOW . should . equal ( ansiColors . yellow + '%s SLOW %s: %s' + ansiColors . reset + '\n' ) ;
134
- newSpecReporter . ERROR . should . equal ( ansiColors . red + '%s ERROR' + ansiColors . reset + '\n' ) ;
135
- newSpecReporter . FINISHED_ERROR . should . equal ( ansiColors . red + ' ERROR' + ansiColors . reset ) ;
136
- newSpecReporter . FINISHED_SUCCESS . should . equal ( ansiColors . green + ' SUCCESS' + ansiColors . reset ) ;
137
- newSpecReporter . FINISHED_DISCONNECTED . should . equal ( ansiColors . red + ' DISCONNECTED' + ansiColors . reset ) ;
138
- newSpecReporter . X_FAILED . should . equal ( ansiColors . red + ' (%d FAILED)' + ansiColors . reset ) ;
139
- newSpecReporter . TOTAL_SUCCESS . should . equal ( ansiColors . green + 'TOTAL: %d SUCCESS' + ansiColors . reset + '\n' ) ;
140
- newSpecReporter . TOTAL_FAILED . should . equal ( ansiColors . red + 'TOTAL: %d FAILED, %d SUCCESS' + ansiColors . reset + '\n' ) ;
133
+ //NOTE: this is temporary as the colors module was updated
134
+ if ( os . platform ( ) === 'win32' ) {
135
+ newSpecReporter . SPEC_FAILURE . should . equal ( '%s %s FAILED\n' ) ;
136
+ newSpecReporter . SPEC_SLOW . should . equal ( '%s SLOW %s: %s\n' ) ;
137
+ newSpecReporter . ERROR . should . equal ( '%s ERROR\n' ) ;
138
+ newSpecReporter . FINISHED_ERROR . should . equal ( ' ERROR' ) ;
139
+ newSpecReporter . FINISHED_SUCCESS . should . equal ( ' SUCCESS' ) ;
140
+ newSpecReporter . FINISHED_DISCONNECTED . should . equal ( ' DISCONNECTED' ) ;
141
+ newSpecReporter . X_FAILED . should . equal ( ' (%d FAILED)' ) ;
142
+ newSpecReporter . TOTAL_SUCCESS . should . equal ( 'TOTAL: %d SUCCESS\n' ) ;
143
+ newSpecReporter . TOTAL_FAILED . should . equal ( 'TOTAL: %d FAILED, %d SUCCESS\n' ) ;
144
+ } else {
145
+ newSpecReporter . SPEC_FAILURE . should . equal ( ansiColors . red + '%s %s FAILED' + ansiColors . reset + '\n' ) ;
146
+ newSpecReporter . SPEC_SLOW . should . equal ( ansiColors . yellow + '%s SLOW %s: %s' + ansiColors . reset + '\n' ) ;
147
+ newSpecReporter . ERROR . should . equal ( ansiColors . red + '%s ERROR' + ansiColors . reset + '\n' ) ;
148
+ newSpecReporter . FINISHED_ERROR . should . equal ( ansiColors . red + ' ERROR' + ansiColors . reset ) ;
149
+ newSpecReporter . FINISHED_SUCCESS . should . equal ( ansiColors . green + ' SUCCESS' + ansiColors . reset ) ;
150
+ newSpecReporter . FINISHED_DISCONNECTED . should . equal ( ansiColors . red + ' DISCONNECTED' + ansiColors . reset ) ;
151
+ newSpecReporter . X_FAILED . should . equal ( ansiColors . red + ' (%d FAILED)' + ansiColors . reset ) ;
152
+ newSpecReporter . TOTAL_SUCCESS . should . equal ( ansiColors . green + 'TOTAL: %d SUCCESS' + ansiColors . reset + '\n' ) ;
153
+ newSpecReporter . TOTAL_FAILED . should . equal ( ansiColors . red + 'TOTAL: %d FAILED, %d SUCCESS' + ansiColors . reset + '\n' ) ;
154
+ }
141
155
} ) ;
142
156
} ) ;
143
157
@@ -349,7 +363,7 @@ describe('SpecReporter', function () {
349
363
} ) ;
350
364
} ) ;
351
365
} ) ;
352
-
366
+
353
367
describe ( 'onSpecFailure' , function ( ) {
354
368
describe ( 'with FAIL_FAST option' , function ( ) {
355
369
var newSpecReporter ;
0 commit comments