{"action":"created","issue":{"url":"https://api.github.com/repos/sonyschan/cucumberjs-junitxml/issues/4","labels_url":"https://api.github.com/repos/sonyschan/cucumberjs-junitxml/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/sonyschan/cucumberjs-junitxml/issues/4/comments","events_url":"https://api.github.com/repos/sonyschan/cucumberjs-junitxml/issues/4/events","html_url":"https://github.com/sonyschan/cucumberjs-junitxml/issues/4","id":73256012,"number":4,"title":"Reporter fails if reportDir does not exist","user":{"login":"davidparsson","id":325325,"avatar_url":"https://avatars.githubusercontent.com/u/325325?v=3","gravatar_id":"","url":"https://api.github.com/users/davidparsson","html_url":"https://github.com/davidparsson","followers_url":"https://api.github.com/users/davidparsson/followers","following_url":"https://api.github.com/users/davidparsson/following{/other_user}","gists_url":"https://api.github.com/users/davidparsson/gists{/gist_id}","starred_url":"https://api.github.com/users/davidparsson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidparsson/subscriptions","organizations_url":"https://api.github.com/users/davidparsson/orgs","repos_url":"https://api.github.com/users/davidparsson/repos","events_url":"https://api.github.com/users/davidparsson/events{/privacy}","received_events_url":"https://api.github.com/users/davidparsson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-05T09:12:32Z","updated_at":"2015-05-06T01:38:55Z","closed_at":null,"body":"Configuring a `reportDir` in `reporter.js` that does not exist gives the following error:\r\n\r\n    Error: ENOENT, no such file or directory '/Path/to/build/test_results/e2e/results.xml'\r\n      at Object.fs.openSync (fs.js:439:18)\r\n      at /Path/to/test/e2e/features/support/cucumberjs-junitxml-reporter.js:105:23\r\n      // ....\r\n\r\nI was thinking of creating a PR since this seemed like an easy fix, utilizing [`mkdirp.sync(reportDir)`](https://www.npmjs.com/package/mkdirp#mkdirp-sync-dir-opts) to create the report directory.\r\n\r\nBut then it hit me that this would require every user of this package to manually install `mkdirp` along side with this one, and that's not good.\r\n\r\nA solution to this would be if `reporter.js` was kept in the `cucumberjs-junitxml` package, and required from a file in the `support` directory, instead of being copied to the `support` directory as is recommended today. That's a design that appeals to me since it also reduces duplication.\r\n\r\nThen the only thing needed to get up and running in that case would be to create a file in the `support` directory that would look something like this:\r\n\r\n    module.exports = require('cucumberjs-junitxml').reporter({\r\n      reportFilePath: 'my/custom/path.xml'\r\n    });\r\n\r\nWhat do you think?"},"comment":{"url":"https://api.github.com/repos/sonyschan/cucumberjs-junitxml/issues/comments/99284028","html_url":"https://github.com/sonyschan/cucumberjs-junitxml/issues/4#issuecomment-99284028","issue_url":"https://api.github.com/repos/sonyschan/cucumberjs-junitxml/issues/4","id":99284028,"user":{"login":"sonyschan","id":1468171,"avatar_url":"https://avatars.githubusercontent.com/u/1468171?v=3","gravatar_id":"","url":"https://api.github.com/users/sonyschan","html_url":"https://github.com/sonyschan","followers_url":"https://api.github.com/users/sonyschan/followers","following_url":"https://api.github.com/users/sonyschan/following{/other_user}","gists_url":"https://api.github.com/users/sonyschan/gists{/gist_id}","starred_url":"https://api.github.com/users/sonyschan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sonyschan/subscriptions","organizations_url":"https://api.github.com/users/sonyschan/orgs","repos_url":"https://api.github.com/users/sonyschan/repos","events_url":"https://api.github.com/users/sonyschan/events{/privacy}","received_events_url":"https://api.github.com/users/sonyschan/received_events","type":"User","site_admin":false},"created_at":"2015-05-06T01:38:55Z","updated_at":"2015-05-06T01:38:55Z","body":"Good point. It's nice to have the report path configurable and reduce file duplication.\r\nDid you make such change in you devbox? Feel free to send a PR if you've done. :)"}}