filfreire
(Filipe Freire)
March 6, 2020, 6:29pm
1
EDIT: created issue newman#2255 and proposed pull-request newman#2257 to tackle this question.
I have console.log(...)
in my PreRequest and Test stages that I’d like to be printed on the console without the |
chars getting printed out. Is there any flag I can use to disable it?
Right now it looks like this:
GET http://somerequest
┌
│ <something i console.log'd out>
└
I’d like it to just plainly print the output:
GET http://somerequest
<something i console.log'd out>
Hey @filfreire
No setting or flag for that but I suspect it’s coming from here:
subsets,
symbols;
/**
* A set of symbol groups for use in different situations: regular, windows friendly unicode, and plain text.
*
* @type {Object}
*/
subsets = {
regular: {
console: {
top: '┌',
middle: '│',
bottom: '└'
},
dot: '.',
folder: '❏',
root: '→',
sub: '↳',
ok: '✓',
error: '✖'
The console part of the reporter is here:
return;
}
// print each test assertions
print.lf('%s %s', passed ? colors.green(` ${symbols.ok} `) :
colors.red.bold(pad(this.summary.run.failures.length, 3, SPC) + symbols.dot), passed ?
colors.gray(o.assertion) : colors.red.bold(o.assertion));
});
// show user console logs in a neatly formatted way (provided user has not disabled the same)
!reporterOptions.noConsole && emitter.on('console', function (err, o) {
if (err) { return; }
var color = colors[o.level] || colors.gray,
message;
// we first merge all messages to a string. while merging we run the values to util.inspect to colour code the
// messages based on data type
message = wrap(_.reduce(o.messages, function (log, message) { // wrap the whole message to the window size
return (log += (log ? colors.white(', ') : '') + inspect(message));
}, E), ` ${color(symbols.console.middle)} `); // add an indentation line at the beginning
That project is open source so maybe an improvement that you could help to add
1 Like
filfreire
(Filipe Freire)
March 6, 2020, 7:13pm
3
I was actually checking through the same code and trying to get a “custom” reporter with that part changed to work locally
1 Like
Great minds
I think you could modify Newman locally easy enough if you have that globally installed or using the library.
1 Like