Skip to content

Commit dfe1bc8

Browse files
committed
Added an improvement for child process output when running in parallel mode with test workers
1 parent 833ea2c commit dfe1bc8

File tree

2 files changed

+5
-17
lines changed

2 files changed

+5
-17
lines changed

lib/reporter/index.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,6 @@ class Reporter extends SimplifiedReporter {
112112
////////////////////////////////////////////////////////////
113113
logTestCase(testName) {
114114
if (this.settings.live_output || !this.settings.parallel_mode) {
115-
// if (this.settings.silent) {
116-
// const ora = require('ora');
117-
// this.runSpinner = ora({
118-
// text: `Running ${colors.green(testName)}${colors.stack_trace(':')}\n`
119-
// }).start();
120-
// } else {
121115
// eslint-disable-next-line no-console
122116
console.log(`${(!this.settings.silent?'\n\n':'')}\n Running ${colors.green(testName)}${colors.stack_trace(':')}`);
123117

@@ -127,7 +121,7 @@ class Reporter extends SimplifiedReporter {
127121
//}
128122
} else {
129123
// eslint-disable-next-line no-console
130-
console.log(`Results for: ${colors.green(testName)}`);
124+
console.log(`Results for: ${colors.green(testName)}\n`);
131125
}
132126
}
133127

lib/runner/concurrency/child-process.js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const child_process = require('child_process');
22
const EventEmitter = require('events');
3+
const boxen = require('boxen');
34
const {Logger, isObject, symbols} = require('../../utils');
45
const ProcessListener = require('../../runner/process-listener.js');
56

@@ -95,7 +96,7 @@ class ChildProcess extends EventEmitter {
9596
if (this.settings.disable_colors) {
9697
childProcessLabel = ' ' + this.environment + ' ';
9798
} else {
98-
childProcessLabel = '';
99+
childProcessLabel = '';
99100
this.env_label = Logger.colors[color_pair[1]](` ${this.environment} `, Logger.colors.background[color_pair[0]]);
100101
}
101102

@@ -162,16 +163,9 @@ class ChildProcess extends EventEmitter {
162163
this.printLog('');
163164

164165
let status = code > 0 ? symbols.fail : symbols.ok;
165-
status = Logger.colors[color_pair[1]](` ${status} `, Logger.colors.background[color_pair[0]]);
166+
// eslint-disable-next-line no-console
167+
console.log(boxen(this.env_output.join('\n'), {title: `────────────────── ${status} ${this.env_label}`, padding: 1, borderColor: 'cyan'}));
166168

167-
let header = ` ┌────────────── ${status}${this.env_label} `;
168-
let footer = ' └──' + new Array(70).join('─');
169-
170-
header += new Array(Math.max(0, footer.length - header.length + 30)).join('─');
171-
172-
this.printLog(header);
173-
this.printLog(this.env_output.join('\n'));
174-
this.printLog(footer);
175169
code = code || this.processListener.exitCode;
176170
resolve(code);
177171
});

0 commit comments

Comments
 (0)