From b6393b1d3fc9adc59bc387b8013cbad30e3a164f Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Tue, 28 Mar 2023 19:49:53 -0300 Subject: data steps: unfinished behavior & fixes in test lib --- src/util/sugar.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/util') diff --git a/src/util/sugar.js b/src/util/sugar.js index ad36d16b..f3b9e732 100644 --- a/src/util/sugar.js +++ b/src/util/sugar.js @@ -431,6 +431,7 @@ export function _withAggregate(mode, aggregateOpts, fn) { export function showAggregate(topError, { pathToFileURL = f => f, showTraces = true, + print = true, } = {}) { const recursive = (error, {level}) => { let header = showTraces @@ -475,7 +476,13 @@ export function showAggregate(topError, { } }; - console.error(recursive(topError, {level: 0})); + const message = recursive(topError, {level: 0}); + + if (print) { + console.error(message); + } else { + return message; + } } export function decorateErrorWithIndex(fn) { -- cgit 1.3.0-6-gf8a5