Skip to content

Commit 34ab2ba

Browse files
committed
chore(branch): Merge branch 'windows'
2 parents 5f44cf3 + 49a3e65 commit 34ab2ba

File tree

1 file changed

+24
-10
lines changed

1 file changed

+24
-10
lines changed

test/index.spec.js

+24-10
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ var sinonChai = require('sinon-chai');
3939
chai.use(sinonChai);
4040
var should = chai.should();
4141
var expect = chai.expect;
42+
var os = require('os');
4243
var reporterRewire = rewire('../index.js');
4344
var SpecReporter = require('../index.js')['reporter:spec'];
4445

@@ -129,15 +130,28 @@ describe('SpecReporter', function () {
129130
});
130131

131132
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+
}
141155
});
142156
});
143157

@@ -349,7 +363,7 @@ describe('SpecReporter', function () {
349363
});
350364
});
351365
});
352-
366+
353367
describe('onSpecFailure', function () {
354368
describe('with FAIL_FAST option', function () {
355369
var newSpecReporter;

0 commit comments

Comments
 (0)