diff --git a/lib/parallel_cucumber/formatters/formatter.js b/lib/parallel_cucumber/formatters/formatter.js index 8ab6359..1554da3 100644 --- a/lib/parallel_cucumber/formatters/formatter.js +++ b/lib/parallel_cucumber/formatters/formatter.js @@ -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; diff --git a/lib/parallel_cucumber/formatters/json_formatter.js b/lib/parallel_cucumber/formatters/json_formatter.js index fcc417c..3ccdfc9 100644 --- a/lib/parallel_cucumber/formatters/json_formatter.js +++ b/lib/parallel_cucumber/formatters/json_formatter.js @@ -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) {