Skip to content

Commit

Permalink
Merge pull request #797 from nklincoln/condition-for-table
Browse files Browse the repository at this point in the history
Provide conditioning on input to table creation for report
  • Loading branch information
aklenik authored Apr 14, 2020
2 parents 06a0f82 + cd04430 commit f82c5f2
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/caliper-core/lib/master/report/report.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,17 @@ class Report {

/**
* print table
* @param {Map | Map[]} tableArray a table array containing performance information compatible with the npm table module
* @param {string[]} tableArray a table array containing performance information compatible with the npm table module
*/
printTable(tableArray) {
// tableArray[0] = array of column titles
// tableArray[1+] = array column values
let t = table.table(tableArray, {border: table.getBorderCharacters('ramac')});
Logger.info('\n' + t);
if (tableArray.length > 0) {
let t = table.table(tableArray, {border: table.getBorderCharacters('ramac')});
Logger.info('\n' + t);
} else {
Logger.error('No data within test result; implies error within configuration files');
}
}

/**
Expand Down

0 comments on commit f82c5f2

Please sign in to comment.