{"action":"created","comment":{"url":"https://api.github.com/repos/mochajs/mocha/pulls/comments/65005691","id":65005691,"diff_hunk":"@@ -60,4 +60,45 @@ describe('reporters', function() {\n       });\n     });\n   });\n+\n+  describe('json', function() {\n+    it('prints test cases with --reporter-options output', function(done) {\n+      var randomStr = crypto.randomBytes(8).toString('hex');\n+      var tmpDir = os.tmpDir().replace(new RegExp(path.sep + '$'), '');\n+      var tmpFile = tmpDir + path.sep + 'test-json-reporter-options-' + randomStr + '.json';\n+\n+      var args = ['--reporter=json', '--reporter-options', 'output=' + tmpFile];\n+      run('passing.js', args, function(err, result) {\n+        if (err) return done(err);\n+\n+        var json = fs.readFileSync(tmpFile, 'utf8');\n+        fs.unlinkSync(tmpFile);\n+        var results = JSON.parse(json);\n+        assert(results.passes && results.passes.length === 2, 'JSON did not contain the expected results.');","path":"test/integration/reporters.js","position":18,"original_position":18,"commit_id":"054a1a6a0810444cd01f41a79b5f700ffe1fe623","original_commit_id":"054a1a6a0810444cd01f41a79b5f700ffe1fe623","user":{"login":"dasilvacontin","id":1260830,"avatar_url":"https://avatars.githubusercontent.com/u/1260830?v=3","gravatar_id":"","url":"https://api.github.com/users/dasilvacontin","html_url":"https://github.com/dasilvacontin","followers_url":"https://api.github.com/users/dasilvacontin/followers","following_url":"https://api.github.com/users/dasilvacontin/following{/other_user}","gists_url":"https://api.github.com/users/dasilvacontin/gists{/gist_id}","starred_url":"https://api.github.com/users/dasilvacontin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dasilvacontin/subscriptions","organizations_url":"https://api.github.com/users/dasilvacontin/orgs","repos_url":"https://api.github.com/users/dasilvacontin/repos","events_url":"https://api.github.com/users/dasilvacontin/events{/privacy}","received_events_url":"https://api.github.com/users/dasilvacontin/received_events","type":"User","site_admin":false},"body":"`results.passes && results.passes.length === 2` -> `results.passes.length === 2`.\r\n\r\nThis way we'll know if it failed for a deeper reason (if it didn't even have a `passes` array).","created_at":"2016-05-29T14:18:22Z","updated_at":"2016-05-29T14:18:22Z","html_url":"https://github.com/mochajs/mocha/pull/2184#discussion_r65005691","pull_request_url":"https://api.github.com/repos/mochajs/mocha/pulls/2184","_links":{"self":{"href":"https://api.github.com/repos/mochajs/mocha/pulls/comments/65005691"},"html":{"href":"https://github.com/mochajs/mocha/pull/2184#discussion_r65005691"},"pull_request":{"href":"https://api.github.com/repos/mochajs/mocha/pulls/2184"}}},"pull_request":{"url":"https://api.github.com/repos/mochajs/mocha/pulls/2184","id":65053647,"html_url":"https://github.com/mochajs/mocha/pull/2184","diff_url":"https://github.com/mochajs/mocha/pull/2184.diff","patch_url":"https://github.com/mochajs/mocha/pull/2184.patch","issue_url":"https://api.github.com/repos/mochajs/mocha/issues/2184","number":2184,"state":"open","locked":false,"title":"Added support for multiple reporters.","user":{"login":"santiagoaguiar","id":963231,"avatar_url":"https://avatars.githubusercontent.com/u/963231?v=3","gravatar_id":"","url":"https://api.github.com/users/santiagoaguiar","html_url":"https://github.com/santiagoaguiar","followers_url":"https://api.github.com/users/santiagoaguiar/followers","following_url":"https://api.github.com/users/santiagoaguiar/following{/other_user}","gists_url":"https://api.github.com/users/santiagoaguiar/gists{/gist_id}","starred_url":"https://api.github.com/users/santiagoaguiar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/santiagoaguiar/subscriptions","organizations_url":"https://api.github.com/users/santiagoaguiar/orgs","repos_url":"https://api.github.com/users/santiagoaguiar/repos","events_url":"https://api.github.com/users/santiagoaguiar/events{/privacy}","received_events_url":"https://api.github.com/users/santiagoaguiar/received_events","type":"User","site_admin":false},"body":"Rework of #2091, rebased to master.\r\n\r\nIncludes work from @benvinegar & @misterdjules, this PR also:\r\n\r\n* Removes support for `--reporter json:<outputfile>` which was added on previous PRs, instead reporters that  support output to files should use `--reporter-options`.\r\n* Added utility methods on `Base` reporter to open an `output` option provided on reporter options as an output file, and write to it. This is a generalization of the mechanism used by the `xunit` reporter to other reporters: `json`, `json-cov`, `html-cov`, `markdown`. All those reporters, and the `xunit` reporter, now inherit from `Base` and use these utility methods to write their output.\r\n* Fixes lint warnings.\r\n* Fixed issues with parsing the reporterOptions when there were multiple reporters.\r\n* Adds a test case to check that the `json` reporter writes to the file specified by the <reporter>:<outputPath> option.\r\n* Adds method documentation.\r\n\r\nSubmitted as PR independent of #2091 since it's a somewhat different approach. I think this one is better, simpler, and makes more sense, but I leave the other PR in case we want to go the way @benvinegar was proposing (using the `--reporter <name>:<outputfile>` syntax.)","created_at":"2016-04-02T23:33:02Z","updated_at":"2016-05-29T14:18:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"56aacd3e57a769a678a2345c6bc012769a98283e","assignee":{"login":"dasilvacontin","id":1260830,"avatar_url":"https://avatars.githubusercontent.com/u/1260830?v=3","gravatar_id":"","url":"https://api.github.com/users/dasilvacontin","html_url":"https://github.com/dasilvacontin","followers_url":"https://api.github.com/users/dasilvacontin/followers","following_url":"https://api.github.com/users/dasilvacontin/following{/other_user}","gists_url":"https://api.github.com/users/dasilvacontin/gists{/gist_id}","starred_url":"https://api.github.com/users/dasilvacontin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dasilvacontin/subscriptions","organizations_url":"https://api.github.com/users/dasilvacontin/orgs","repos_url":"https://api.github.com/users/dasilvacontin/repos","events_url":"https://api.github.com/users/dasilvacontin/events{/privacy}","received_events_url":"https://api.github.com/users/dasilvacontin/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/mochajs/mocha/pulls/2184/commits","review_comments_url":"https://api.github.com/repos/mochajs/mocha/pulls/2184/comments","review_comment_url":"https://api.github.com/repos/mochajs/mocha/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mochajs/mocha/issues/2184/comments","statuses_url":"https://api.github.com/repos/mochajs/mocha/statuses/054a1a6a0810444cd01f41a79b5f700ffe1fe623","head":{"label":"santiagoaguiar:multiple-reporters-no-output","ref":"multiple-reporters-no-output","sha":"054a1a6a0810444cd01f41a79b5f700ffe1fe623","user":{"login":"santiagoaguiar","id":963231,"avatar_url":"https://avatars.githubusercontent.com/u/963231?v=3","gravatar_id":"","url":"https://api.github.com/users/santiagoaguiar","html_url":"https://github.com/santiagoaguiar","followers_url":"https://api.github.com/users/santiagoaguiar/followers","following_url":"https://api.github.com/users/santiagoaguiar/following{/other_user}","gists_url":"https://api.github.com/users/santiagoaguiar/gists{/gist_id}","starred_url":"https://api.github.com/users/santiagoaguiar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/santiagoaguiar/subscriptions","organizations_url":"https://api.github.com/users/santiagoaguiar/orgs","repos_url":"https://api.github.com/users/santiagoaguiar/repos","events_url":"https://api.github.com/users/santiagoaguiar/events{/privacy}","received_events_url":"https://api.github.com/users/santiagoaguiar/received_events","type":"User","site_admin":false},"repo":{"id":50997944,"name":"mocha","full_name":"santiagoaguiar/mocha","owner":{"login":"santiagoaguiar","id":963231,"avatar_url":"https://avatars.githubusercontent.com/u/963231?v=3","gravatar_id":"","url":"https://api.github.com/users/santiagoaguiar","html_url":"https://github.com/santiagoaguiar","followers_url":"https://api.github.com/users/santiagoaguiar/followers","following_url":"https://api.github.com/users/santiagoaguiar/following{/other_user}","gists_url":"https://api.github.com/users/santiagoaguiar/gists{/gist_id}","starred_url":"https://api.github.com/users/santiagoaguiar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/santiagoaguiar/subscriptions","organizations_url":"https://api.github.com/users/santiagoaguiar/orgs","repos_url":"https://api.github.com/users/santiagoaguiar/repos","events_url":"https://api.github.com/users/santiagoaguiar/events{/privacy}","received_events_url":"https://api.github.com/users/santiagoaguiar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/santiagoaguiar/mocha","description":"mocha - simple, flexible, fun javascript test framework for node.js & the browser. (BDD, TDD, QUnit styles via interfaces)","fork":true,"url":"https://api.github.com/repos/santiagoaguiar/mocha","forks_url":"https://api.github.com/repos/santiagoaguiar/mocha/forks","keys_url":"https://api.github.com/repos/santiagoaguiar/mocha/keys{/key_id}","collaborators_url":"https://api.github.com/repos/santiagoaguiar/mocha/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/santiagoaguiar/mocha/teams","hooks_url":"https://api.github.com/repos/santiagoaguiar/mocha/hooks","issue_events_url":"https://api.github.com/repos/santiagoaguiar/mocha/issues/events{/number}","events_url":"https://api.github.com/repos/santiagoaguiar/mocha/events","assignees_url":"https://api.github.com/repos/santiagoaguiar/mocha/assignees{/user}","branches_url":"https://api.github.com/repos/santiagoaguiar/mocha/branches{/branch}","tags_url":"https://api.github.com/repos/santiagoaguiar/mocha/tags","blobs_url":"https://api.github.com/repos/santiagoaguiar/mocha/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/santiagoaguiar/mocha/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/santiagoaguiar/mocha/git/refs{/sha}","trees_url":"https://api.github.com/repos/santiagoaguiar/mocha/git/trees{/sha}","statuses_url":"https://api.github.com/repos/santiagoaguiar/mocha/statuses/{sha}","languages_url":"https://api.github.com/repos/santiagoaguiar/mocha/languages","stargazers_url":"https://api.github.com/repos/santiagoaguiar/mocha/stargazers","contributors_url":"https://api.github.com/repos/santiagoaguiar/mocha/contributors","subscribers_url":"https://api.github.com/repos/santiagoaguiar/mocha/subscribers","subscription_url":"https://api.github.com/repos/santiagoaguiar/mocha/subscription","commits_url":"https://api.github.com/repos/santiagoaguiar/mocha/commits{/sha}","git_commits_url":"https://api.github.com/repos/santiagoaguiar/mocha/git/commits{/sha}","comments_url":"https://api.github.com/repos/santiagoaguiar/mocha/comments{/number}","issue_comment_url":"https://api.github.com/repos/santiagoaguiar/mocha/issues/comments{/number}","contents_url":"https://api.github.com/repos/santiagoaguiar/mocha/contents/{+path}","compare_url":"https://api.github.com/repos/santiagoaguiar/mocha/compare/{base}...{head}","merges_url":"https://api.github.com/repos/santiagoaguiar/mocha/merges","archive_url":"https://api.github.com/repos/santiagoaguiar/mocha/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/santiagoaguiar/mocha/downloads","issues_url":"https://api.github.com/repos/santiagoaguiar/mocha/issues{/number}","pulls_url":"https://api.github.com/repos/santiagoaguiar/mocha/pulls{/number}","milestones_url":"https://api.github.com/repos/santiagoaguiar/mocha/milestones{/number}","notifications_url":"https://api.github.com/repos/santiagoaguiar/mocha/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/santiagoaguiar/mocha/labels{/name}","releases_url":"https://api.github.com/repos/santiagoaguiar/mocha/releases{/id}","deployments_url":"https://api.github.com/repos/santiagoaguiar/mocha/deployments","created_at":"2016-02-03T12:24:32Z","updated_at":"2016-02-03T12:24:33Z","pushed_at":"2016-04-25T16:55:25Z","git_url":"git://github.com/santiagoaguiar/mocha.git","ssh_url":"git@github.com:santiagoaguiar/mocha.git","clone_url":"https://github.com/santiagoaguiar/mocha.git","svn_url":"https://github.com/santiagoaguiar/mocha","homepage":"http://visionmedia.github.com/mocha","size":5542,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mochajs:master","ref":"master","sha":"c0f9be244bff479e948f59d1bdb825a45c2cb40c","user":{"login":"mochajs","id":8770005,"avatar_url":"https://avatars.githubusercontent.com/u/8770005?v=3","gravatar_id":"","url":"https://api.github.com/users/mochajs","html_url":"https://github.com/mochajs","followers_url":"https://api.github.com/users/mochajs/followers","following_url":"https://api.github.com/users/mochajs/following{/other_user}","gists_url":"https://api.github.com/users/mochajs/gists{/gist_id}","starred_url":"https://api.github.com/users/mochajs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mochajs/subscriptions","organizations_url":"https://api.github.com/users/mochajs/orgs","repos_url":"https://api.github.com/users/mochajs/repos","events_url":"https://api.github.com/users/mochajs/events{/privacy}","received_events_url":"https://api.github.com/users/mochajs/received_events","type":"Organization","site_admin":false},"repo":{"id":1451352,"name":"mocha","full_name":"mochajs/mocha","owner":{"login":"mochajs","id":8770005,"avatar_url":"https://avatars.githubusercontent.com/u/8770005?v=3","gravatar_id":"","url":"https://api.github.com/users/mochajs","html_url":"https://github.com/mochajs","followers_url":"https://api.github.com/users/mochajs/followers","following_url":"https://api.github.com/users/mochajs/following{/other_user}","gists_url":"https://api.github.com/users/mochajs/gists{/gist_id}","starred_url":"https://api.github.com/users/mochajs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mochajs/subscriptions","organizations_url":"https://api.github.com/users/mochajs/orgs","repos_url":"https://api.github.com/users/mochajs/repos","events_url":"https://api.github.com/users/mochajs/events{/privacy}","received_events_url":"https://api.github.com/users/mochajs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mochajs/mocha","description":"mocha - simple, flexible, fun javascript test framework for node.js & the browser","fork":false,"url":"https://api.github.com/repos/mochajs/mocha","forks_url":"https://api.github.com/repos/mochajs/mocha/forks","keys_url":"https://api.github.com/repos/mochajs/mocha/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mochajs/mocha/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mochajs/mocha/teams","hooks_url":"https://api.github.com/repos/mochajs/mocha/hooks","issue_events_url":"https://api.github.com/repos/mochajs/mocha/issues/events{/number}","events_url":"https://api.github.com/repos/mochajs/mocha/events","assignees_url":"https://api.github.com/repos/mochajs/mocha/assignees{/user}","branches_url":"https://api.github.com/repos/mochajs/mocha/branches{/branch}","tags_url":"https://api.github.com/repos/mochajs/mocha/tags","blobs_url":"https://api.github.com/repos/mochajs/mocha/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mochajs/mocha/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mochajs/mocha/git/refs{/sha}","trees_url":"https://api.github.com/repos/mochajs/mocha/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mochajs/mocha/statuses/{sha}","languages_url":"https://api.github.com/repos/mochajs/mocha/languages","stargazers_url":"https://api.github.com/repos/mochajs/mocha/stargazers","contributors_url":"https://api.github.com/repos/mochajs/mocha/contributors","subscribers_url":"https://api.github.com/repos/mochajs/mocha/subscribers","subscription_url":"https://api.github.com/repos/mochajs/mocha/subscription","commits_url":"https://api.github.com/repos/mochajs/mocha/commits{/sha}","git_commits_url":"https://api.github.com/repos/mochajs/mocha/git/commits{/sha}","comments_url":"https://api.github.com/repos/mochajs/mocha/comments{/number}","issue_comment_url":"https://api.github.com/repos/mochajs/mocha/issues/comments{/number}","contents_url":"https://api.github.com/repos/mochajs/mocha/contents/{+path}","compare_url":"https://api.github.com/repos/mochajs/mocha/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mochajs/mocha/merges","archive_url":"https://api.github.com/repos/mochajs/mocha/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mochajs/mocha/downloads","issues_url":"https://api.github.com/repos/mochajs/mocha/issues{/number}","pulls_url":"https://api.github.com/repos/mochajs/mocha/pulls{/number}","milestones_url":"https://api.github.com/repos/mochajs/mocha/milestones{/number}","notifications_url":"https://api.github.com/repos/mochajs/mocha/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mochajs/mocha/labels{/name}","releases_url":"https://api.github.com/repos/mochajs/mocha/releases{/id}","deployments_url":"https://api.github.com/repos/mochajs/mocha/deployments","created_at":"2011-03-07T18:44:25Z","updated_at":"2016-05-29T05:36:08Z","pushed_at":"2016-05-28T19:21:07Z","git_url":"git://github.com/mochajs/mocha.git","ssh_url":"git@github.com:mochajs/mocha.git","clone_url":"https://github.com/mochajs/mocha.git","svn_url":"https://github.com/mochajs/mocha","homepage":"http://mochajs.org","size":10479,"stargazers_count":9442,"watchers_count":9442,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1421,"mirror_url":null,"open_issues_count":269,"forks":1421,"open_issues":269,"watchers":9442,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mochajs/mocha/pulls/2184"},"html":{"href":"https://github.com/mochajs/mocha/pull/2184"},"issue":{"href":"https://api.github.com/repos/mochajs/mocha/issues/2184"},"comments":{"href":"https://api.github.com/repos/mochajs/mocha/issues/2184/comments"},"review_comments":{"href":"https://api.github.com/repos/mochajs/mocha/pulls/2184/comments"},"review_comment":{"href":"https://api.github.com/repos/mochajs/mocha/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mochajs/mocha/pulls/2184/commits"},"statuses":{"href":"https://api.github.com/repos/mochajs/mocha/statuses/054a1a6a0810444cd01f41a79b5f700ffe1fe623"}}}}
{"actor":{"display_login":"dasilvacontin"}}