From ce99231d064b4f790c3c14d852f64bdf13021076 Mon Sep 17 00:00:00 2001 From: AbdulRafey612 Date: Tue, 15 Mar 2022 01:12:12 +0500 Subject: [PATCH] Adding the --reporter-cli-summary-only option. Only prints collection summary and failures --- lib/reporters/cli/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/reporters/cli/index.js b/lib/reporters/cli/index.js index 3728a2874..8b1fa9afe 100644 --- a/lib/reporters/cli/index.js +++ b/lib/reporters/cli/index.js @@ -137,7 +137,7 @@ PostmanCLIReporter = function (emitter, reporterOptions, options) { }); emitter.on('beforeItem', function (err, o) { - if (err) { return; } + if (err || options.reporter.cli.summaryOnly) { return; } var itemGroup = o.item.parent(), root = !itemGroup || (itemGroup === options.collection); @@ -158,6 +158,7 @@ PostmanCLIReporter = function (emitter, reporterOptions, options) { // print out the request name to be executed and start a spinner emitter.on('beforeRequest', function (err, o) { + if (options.reporter.cli.summaryOnly) { return; } if (err || !o.request) { return; } if (reporterOptions.showTimestamps) { @@ -180,6 +181,7 @@ PostmanCLIReporter = function (emitter, reporterOptions, options) { // output the response code, reason and time emitter.on('request', function (err, o) { + if (options.reporter.cli.summaryOnly) { return; } if (err) { print.lf(colors.red('[errored]')); print.lf(colors.red(' %s'), err.message);