Skip to content

Commit

Permalink
Writing report during tests run
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkNaumenko committed Jun 25, 2018
1 parent 2a4f59d commit b28b34e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/parallel_cucumber/formatters/formatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@ var Formatter = function(options) {
self._out.write(data, 'utf8');
};

self._rewriteReport = function (data) {
if (options.outFilePath) {
FS.writeFile(options.outFilePath, data, function (err) {
if (err) {
throw err;
}
});
}
};

self.end = function(callback) {
if (self._outNeedsClosing) {
self._outNeedsClosing = false;
Expand Down
1 change: 1 addition & 0 deletions lib/parallel_cucumber/formatters/json_formatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ var JsonFormatter = function(options) {
Debug('New feature');
self._features.push(currentFeature);
}
self._rewriteReport(JSON.stringify(self._features));
};

self.end = function(callback) {
Expand Down

0 comments on commit b28b34e

Please sign in to comment.