Skip to content

Commit

Permalink
send logger http output from child process (#3462)
Browse files Browse the repository at this point in the history
  • Loading branch information
gravityvi committed Nov 2, 2022
1 parent 6c727ee commit 2cd3314
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/reporter/global-reporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ module.exports = class GlobalReporter {
});
}

addTestSuiteResults(testResults) {
addTestSuiteResults(testResults, httpOutput) {
testResults = testResults || {};
testResults.httpOutput = Logger.collectOutput().map(item => {
testResults.httpOutput = (httpOutput || Logger.collectOutput()).map(item => {
return [item[0], this.ansiConverter.toHtml(item[1]),
(item[2] ? this.ansiConverter.toHtml(item[2]) : '')];
});
Expand All @@ -71,7 +71,7 @@ module.exports = class GlobalReporter {
if (!Concurrency.isTestWorker()) {
emitter.on('message', data => {
data = JSON.parse(data);
this.addTestSuiteResults(data.results);
this.addTestSuiteResults(data.results, data.httpOutput);
});
}
}
Expand Down
3 changes: 2 additions & 1 deletion lib/testsuite/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,8 @@ class TestSuite {
process.send(SafeJSON.stringify({
type: 'testsuite_finished',
itemKey: process.env.__NIGHTWATCH_ENV_LABEL,
results: this.reporter.exportResults()
results: this.reporter.exportResults(),
httpOutput: Logger.collectOutput()
}));
}

Expand Down

0 comments on commit 2cd3314

Please sign in to comment.