Colorize test result diff output.
This commit is contained in:
parent
cbc8b64854
commit
497da1d29b
@ -3,6 +3,7 @@
|
||||
var util = require('util');
|
||||
var path = require('path');
|
||||
var fs = require('fs');
|
||||
var chalk = require('chalk');
|
||||
|
||||
var OSRMError = class extends Error {
|
||||
constructor (process, code, msg, log, lines) {
|
||||
@ -118,9 +119,9 @@ module.exports = {
|
||||
this.diff.forEach((row) => {
|
||||
var rowString = '| ';
|
||||
this.headers.forEach((header) => {
|
||||
if (!row.c_status) rowString += ' ' + row[header] + ' | ';
|
||||
else if (row.c_status === 'undefined') rowString += '(-) ' + row[header] + ' | ';
|
||||
else rowString += '(+) ' + row[header] + ' | ';
|
||||
if (!row.c_status) rowString += chalk.green(' ' + row[header] + ' | ');
|
||||
else if (row.c_status === 'undefined') rowString += chalk.yellow('(-) ' + row[header] + ' | ');
|
||||
else rowString += chalk.red('(+) ' + row[header] + ' | ');
|
||||
});
|
||||
s.push(rowString);
|
||||
});
|
||||
|
@ -8,7 +8,8 @@
|
||||
"d3-queue": "^2.0.3",
|
||||
"node-timeout": "0.0.4",
|
||||
"request": "^2.69.0",
|
||||
"xmlbuilder": "^4.2.1"
|
||||
"xmlbuilder": "^4.2.1",
|
||||
"chalk": "^1.1.3"
|
||||
},
|
||||
"bin": {
|
||||
"cucumber": "./node_modules/cucumber/bin/cucumber.js"
|
||||
|
Loading…
Reference in New Issue
Block a user