explicitly cast to strings for table diffs
This commit is contained in:
parent
224848fc11
commit
6567e79ec5
@ -68,7 +68,7 @@ module.exports = function (expected, actual) {
|
|||||||
// header row
|
// header row
|
||||||
cells = []
|
cells = []
|
||||||
headers.forEach( (key) => {
|
headers.forEach( (key) => {
|
||||||
var content = key.padRight(' ', widths[key] );
|
var content = String(key).padRight(' ', widths[key] );
|
||||||
if (columnStatus[key] == false )
|
if (columnStatus[key] == false )
|
||||||
content = okStr + content;
|
content = okStr + content;
|
||||||
cells.push( chalk.white( content ) );
|
cells.push( chalk.white( content ) );
|
||||||
@ -83,7 +83,7 @@ module.exports = function (expected, actual) {
|
|||||||
// expected row
|
// expected row
|
||||||
cells = []
|
cells = []
|
||||||
headers.forEach( (key) => {
|
headers.forEach( (key) => {
|
||||||
var content = row[key].padRight(' ', widths[key] );
|
var content = String(row[key]).padRight(' ', widths[key] );
|
||||||
if (statusRows[i][key] == false)
|
if (statusRows[i][key] == false)
|
||||||
cells.push( chalk.yellow( wantStr + content) );
|
cells.push( chalk.yellow( wantStr + content) );
|
||||||
else {
|
else {
|
||||||
@ -105,7 +105,7 @@ module.exports = function (expected, actual) {
|
|||||||
if (rowError) {
|
if (rowError) {
|
||||||
cells = []
|
cells = []
|
||||||
headers.forEach( (key) => {
|
headers.forEach( (key) => {
|
||||||
var content = actual[i][key].padRight(' ', widths[key] );
|
var content = String(actual[i][key]).padRight(' ', widths[key] );
|
||||||
if (statusRows[i][key] == false)
|
if (statusRows[i][key] == false)
|
||||||
cells.push( chalk.red( gotStr + content) );
|
cells.push( chalk.red( gotStr + content) );
|
||||||
else {
|
else {
|
||||||
|
Loading…
Reference in New Issue
Block a user