File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -60,9 +60,16 @@ module.exports = function JsonOutputHook() {
60
60
var path = require (' path' );
61
61
62
62
JsonFormatter .log = function (json ) {
63
- fs .writeFile (path .join (__dirname , ' ./reports/cucumber-test-results.json' ), json, function (err ) {
64
- if (err) throw err;
65
- console .log (' json file location: ' + path .join (__dirname , ' ./reports/cucumber-test-results.json' ));
63
+ var destination = path .join (__dirname , ' ../../reports/cucumber-test-results.json' );
64
+ fs .open (destination, ' w+' , function (err , fd ) {
65
+ if (err) {
66
+ fs .mkdirsSync (destination);
67
+ fd = fs .openSync (destination, ' w+' );
68
+ }
69
+
70
+ fs .writeSync (fd, json);
71
+
72
+ console .log (' json file location: ' + destination);
66
73
});
67
74
};
68
75
@@ -127,4 +134,4 @@ Copyright for portions of project [gulp-protractor-cucumber-html-report](https:/
127
134
128
135
0.0.5:
129
136
- More robust creation of the output directory [ thanks smuldr!] ( https://github.com/smuldr )
130
- - Fixed the HTML reporter when using multiple feature files
137
+ - Fixed the HTML reporter when using multiple feature files
You can’t perform that action at this time.
0 commit comments