Skip to content

Commit

Permalink
added tests - now we have 100% coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
whyboris committed Jun 1, 2017
1 parent dbfc1e8 commit bd5f73d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/data/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ DataStore.prototype.saveResultToSuite = function(suite, browser, result) {

if(result.log && result.log[0] !== null){
if (result.log.length > 1) {
for (var i = 0; i < result.log.length; i++) {
for (var i = 1; i < result.log.length; i++) {
result.log[0] = result.log[0] + '\n' + result.log[i];
}
}
Expand Down
9 changes: 9 additions & 0 deletions test/data.store.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,15 @@ describe('data/store.js - test suite', function() {

assert.deepEqual(expected, brwsr.errors);
});

it('should create brwsr.errors from result.log when there are more errors', function() {
result.log = ['failure01\nfailure02','failure03\nfailure04'];
var expected = ['failure01', 'failure02', 'failure03', 'failure04'];

sut.saveResultToSuite(suite, browser, result);

assert.deepEqual(expected, brwsr.errors);
});
});

/**
Expand Down
11 changes: 10 additions & 1 deletion test/printers.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ describe('printers.js test suite', function() {
},
'blackBright': sinon.stub(),
'white': sinon.stub(),
'yellow': sinon.stub()
'yellow': sinon.stub(),
'xterm': sinon.stub()
};

colorConsoleLogsFake = sinon.stub();
Expand All @@ -47,6 +48,14 @@ describe('printers.js test suite', function() {
done();
});


describe('setColorOptions()', function() {
it('should set color of console logs', function() {
sut.setColorOptions({"colorConsoleLogs": 99});
ok(sut.__get__('clc').xterm.callCount === 1);
});
});

/**
* printBrowserErrors() tests
*/
Expand Down

0 comments on commit bd5f73d

Please sign in to comment.