Skip to content

Commit 7956df5

Browse files
committed
add logging similar to mocha
1 parent b62c92e commit 7956df5

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

lib/cli.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ var path = require('path'),
88
module.exports = require('coa').Cmd()
99
.name(process.argv[1])
1010
.helpful()
11-
.title('Compares two html-files\n' +
12-
'Red text'.red + ' should be removed from the first html relative to the second one, ' +
13-
'green text'.green + ' should be added')
11+
.title('Compares two html-files')
1412
.opt()
1513
.name('version')
1614
.title('Shows the version number')

lib/diff-logger.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function getDiffText(diff, options) {
3535
if (part.removed) color = 'red';
3636

3737
if (color !== 'grey') {
38-
output += (!index ? '\n' : '') + partValue[color];
38+
output += (!index ? '\n' : '') + partValue.inverse[color];
3939

4040
return;
4141
}
@@ -63,7 +63,9 @@ function getDiffText(diff, options) {
6363
function log(diff, options) {
6464
var diffText = getDiffText(diff, options);
6565

66-
console.log(diffText);
66+
if (diffText) {
67+
console.log('+ expected'.inverse.green, '- actual'.inverse.red, '\n', diffText);
68+
}
6769
}
6870

6971
module.exports = {

0 commit comments

Comments
 (0)