Skip to content

Commit

Permalink
Merge pull request #3212 from yardenshoham/issues/3169
Browse files Browse the repository at this point in the history
Fix `--color off` not being respected in summary table
  • Loading branch information
codenirvana committed Mar 14, 2024
2 parents 0bcba86 + bb772e5 commit cd81df4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions lib/reporters/cli/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -426,12 +426,17 @@ _.assignIn(PostmanCLIReporter, {
* @returns {Table} - The constructed collection run statistics table.
*/
parseStatistics (stats, timings, transfers, options) {
var summaryTable;
var summaryTable,
style = { head: [] };

if (cliUtils.noTTY(options.color)) {
style.border = [];
}

// create the summary table
summaryTable = new Table({
chars: options.disableUnicode && cliUtils.cliTableTemplateFallback,
style: { head: [] },
style: style,
head: [E, 'executed', ' failed'],
colAligns: ['right', 'right', 'right'],
colWidths: [25]
Expand Down
2 changes: 1 addition & 1 deletion test/cli/color-tty.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const fs = require('fs'),

describe('CLI output', function () {
// eslint-disable-next-line no-control-regex
const coloredOutput = /^[\u001b[0m]+newman/;
const coloredOutput = /\u001b/;

describe('TTY', function () {
// @todo: Change to assert colored output after https://github.com/shelljs/shelljs/pull/524 is released
Expand Down

0 comments on commit cd81df4

Please sign in to comment.