File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change 1
1
# gulp-protractor-cucumber-html-report
2
2
3
- [ ![ Build Status] ( https://travis-ci.org/mrooding/gulp-protractor-cucumber-html-report.svg?branch=master )] ( https://travis-ci.org/mrooding/gulp-protractor-cucumber-html-report )
4
-
5
3
> Generate html report from JSON file returned by CucumberJS json formatter
6
4
7
5
This is a stand-alone fork of [ grunt-protractor-cucumber-html-report] ( https://github.com/robhil/grunt-protractor-cucumber-html-report )
@@ -62,9 +60,16 @@ module.exports = function JsonOutputHook() {
62
60
var path = require (' path' );
63
61
64
62
JsonFormatter .log = function (json ) {
65
- fs .writeFile (path .join (__dirname , ' ./reports/cucumber-test-results.json' ), json, function (err ) {
66
- if (err) throw err;
67
- 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);
68
73
});
69
74
};
70
75
You can’t perform that action at this time.
0 commit comments