{"action":"created","comment":{"url":"https://api.github.com/repos/mochajs/mocha/pulls/comments/221884951","pull_request_review_id":160638924,"id":221884951,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMTg4NDk1MQ==","diff_hunk":"@@ -8,35 +8,50 @@ var createMockRunner = require('./helpers.js').createMockRunner;\n \n describe('Dot reporter', function() {\n   var stdout;\n-  var stdoutWrite;\n   var runner;\n   var useColors;\n   var windowWidth;\n+  var color;\n \n-  beforeEach(function() {\n-    stdout = [];\n-    stdoutWrite = process.stdout.write;\n+  function runReporter(stubSelf, runner) {\n+    // Reassign stream in order to make a copy of all reporter output\n+    var stdoutWrite = process.stdout.write;\n     process.stdout.write = function(string, enc, callback) {\n       stdout.push(string);\n       stdoutWrite.call(process.stdout, string, enc, callback);\n     };\n+\n+    // Invoke reporter\n+    Dot.call(stubSelf, runner);\n+\n+    // Revert stream reassignment here so reporter output\n+    // can't be corrupted if any test assertions throw\n+    process.stdout.write = stdoutWrite;\n+  }\n+\n+  beforeEach(function() {\n+    stdout = [];\n     useColors = Base.useColors;\n     windowWidth = Base.window.width;\n+    color = Base.color;\n     Base.useColors = false;\n     Base.window.width = 0;\n+    Base.color = function(type, str) {\n+      return type.replace(/ /g, '-') + '_' + str;\n+    };\n   });\n \n   afterEach(function() {\n     Base.useColors = useColors;\n     Base.window.width = windowWidth;\n-    process.stdout.write = stdoutWrite;\n+    Base.color = color;\n+    runner = undefined;\n   });\n \n   describe('on start', function() {\n     it('should return a new line', function() {\n       runner = createMockRunner('start', 'start');\n-      Dot.call({epilogue: function() {}}, runner);\n-      process.stdout.write = stdoutWrite;\n+      runReporter({epilogue: function() {}}, runner);","path":"test/reporters/dot.spec.js","position":54,"original_position":54,"commit_id":"3a3c8d796646e14830763fca15a8f12079165a15","original_commit_id":"3a3c8d796646e14830763fca15a8f12079165a15","user":{"login":"plroebuck","id":16603429,"node_id":"MDQ6VXNlcjE2NjAzNDI5","avatar_url":"https://avatars1.githubusercontent.com/u/16603429?v=4","gravatar_id":"","url":"https://api.github.com/users/plroebuck","html_url":"https://github.com/plroebuck","followers_url":"https://api.github.com/users/plroebuck/followers","following_url":"https://api.github.com/users/plroebuck/following{/other_user}","gists_url":"https://api.github.com/users/plroebuck/gists{/gist_id}","starred_url":"https://api.github.com/users/plroebuck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/plroebuck/subscriptions","organizations_url":"https://api.github.com/users/plroebuck/orgs","repos_url":"https://api.github.com/users/plroebuck/repos","events_url":"https://api.github.com/users/plroebuck/events{/privacy}","received_events_url":"https://api.github.com/users/plroebuck/received_events","type":"User","site_admin":false},"body":"Essentially, do this for _all_ `runReporter` invocations.\r\n\r\n```js\r\n     runReporter({epilogue: function() {}}, runner, showOutput);\r\n```","created_at":"2018-10-02T09:38:32Z","updated_at":"2018-10-02T09:38:32Z","html_url":"https://github.com/mochajs/mocha/pull/3486#discussion_r221884951","pull_request_url":"https://api.github.com/repos/mochajs/mocha/pulls/3486","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/mochajs/mocha/pulls/comments/221884951"},"html":{"href":"https://github.com/mochajs/mocha/pull/3486#discussion_r221884951"},"pull_request":{"href":"https://api.github.com/repos/mochajs/mocha/pulls/3486"}}},"pull_request":{"url":"https://api.github.com/repos/mochajs/mocha/pulls/3486","id":217881666,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE3ODgxNjY2","html_url":"https://github.com/mochajs/mocha/pull/3486","diff_url":"https://github.com/mochajs/mocha/pull/3486.diff","patch_url":"https://github.com/mochajs/mocha/pull/3486.patch","issue_url":"https://api.github.com/repos/mochajs/mocha/issues/3486","number":3486,"state":"open","locked":false,"title":"fix slow test for dot reporter\"","user":{"login":"outsideris","id":390146,"node_id":"MDQ6VXNlcjM5MDE0Ng==","avatar_url":"https://avatars1.githubusercontent.com/u/390146?v=4","gravatar_id":"","url":"https://api.github.com/users/outsideris","html_url":"https://github.com/outsideris","followers_url":"https://api.github.com/users/outsideris/followers","following_url":"https://api.github.com/users/outsideris/following{/other_user}","gists_url":"https://api.github.com/users/outsideris/gists{/gist_id}","starred_url":"https://api.github.com/users/outsideris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/outsideris/subscriptions","organizations_url":"https://api.github.com/users/outsideris/orgs","repos_url":"https://api.github.com/users/outsideris/repos","events_url":"https://api.github.com/users/outsideris/events{/privacy}","received_events_url":"https://api.github.com/users/outsideris/received_events","type":"User","site_admin":false},"body":"### Description of the Change\r\nAlthough there is [a slow test case](https://github.com/mochajs/mocha/blob/master/test/reporters/dot.spec.js#L98-L107) for dot reporter, \r\n[coverage](https://coveralls.io/builds/19145852/source?filename=lib/reporters/dot.js#L51) is missed.\r\nSince slow duration is 2(`slow: function() { return 2; }`) and test duration is 2 (`test.duration = 2;`), \r\nthis test is not check slow test actually.\r\n\r\n### Alternate Designs\r\nN/A\r\n\r\n### Why should this be in core?\r\nTests should be run as intended.","created_at":"2018-09-25T07:35:14Z","updated_at":"2018-10-02T09:38:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"45f9425c8f74ab8d7a90432e4c6fc2f2a2abe5f8","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":400124903,"node_id":"MDU6TGFiZWw0MDAxMjQ5MDM=","url":"https://api.github.com/repos/mochajs/mocha/labels/qa","name":"qa","color":"996516","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/mochajs/mocha/pulls/3486/commits","review_comments_url":"https://api.github.com/repos/mochajs/mocha/pulls/3486/comments","review_comment_url":"https://api.github.com/repos/mochajs/mocha/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mochajs/mocha/issues/3486/comments","statuses_url":"https://api.github.com/repos/mochajs/mocha/statuses/3a3c8d796646e14830763fca15a8f12079165a15","head":{"label":"outsideris:dot-report-slow-test","ref":"dot-report-slow-test","sha":"3a3c8d796646e14830763fca15a8f12079165a15","user":{"login":"outsideris","id":390146,"node_id":"MDQ6VXNlcjM5MDE0Ng==","avatar_url":"https://avatars1.githubusercontent.com/u/390146?v=4","gravatar_id":"","url":"https://api.github.com/users/outsideris","html_url":"https://github.com/outsideris","followers_url":"https://api.github.com/users/outsideris/followers","following_url":"https://api.github.com/users/outsideris/following{/other_user}","gists_url":"https://api.github.com/users/outsideris/gists{/gist_id}","starred_url":"https://api.github.com/users/outsideris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/outsideris/subscriptions","organizations_url":"https://api.github.com/users/outsideris/orgs","repos_url":"https://api.github.com/users/outsideris/repos","events_url":"https://api.github.com/users/outsideris/events{/privacy}","received_events_url":"https://api.github.com/users/outsideris/received_events","type":"User","site_admin":false},"repo":{"id":40814233,"node_id":"MDEwOlJlcG9zaXRvcnk0MDgxNDIzMw==","name":"mocha","full_name":"outsideris/mocha","private":false,"owner":{"login":"outsideris","id":390146,"node_id":"MDQ6VXNlcjM5MDE0Ng==","avatar_url":"https://avatars1.githubusercontent.com/u/390146?v=4","gravatar_id":"","url":"https://api.github.com/users/outsideris","html_url":"https://github.com/outsideris","followers_url":"https://api.github.com/users/outsideris/followers","following_url":"https://api.github.com/users/outsideris/following{/other_user}","gists_url":"https://api.github.com/users/outsideris/gists{/gist_id}","starred_url":"https://api.github.com/users/outsideris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/outsideris/subscriptions","organizations_url":"https://api.github.com/users/outsideris/orgs","repos_url":"https://api.github.com/users/outsideris/repos","events_url":"https://api.github.com/users/outsideris/events{/privacy}","received_events_url":"https://api.github.com/users/outsideris/received_events","type":"User","site_admin":false},"html_url":"https://github.com/outsideris/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/outsideris/mocha","forks_url":"https://api.github.com/repos/outsideris/mocha/forks","keys_url":"https://api.github.com/repos/outsideris/mocha/keys{/key_id}","collaborators_url":"https://api.github.com/repos/outsideris/mocha/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/outsideris/mocha/teams","hooks_url":"https://api.github.com/repos/outsideris/mocha/hooks","issue_events_url":"https://api.github.com/repos/outsideris/mocha/issues/events{/number}","events_url":"https://api.github.com/repos/outsideris/mocha/events","assignees_url":"https://api.github.com/repos/outsideris/mocha/assignees{/user}","branches_url":"https://api.github.com/repos/outsideris/mocha/branches{/branch}","tags_url":"https://api.github.com/repos/outsideris/mocha/tags","blobs_url":"https://api.github.com/repos/outsideris/mocha/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/outsideris/mocha/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/outsideris/mocha/git/refs{/sha}","trees_url":"https://api.github.com/repos/outsideris/mocha/git/trees{/sha}","statuses_url":"https://api.github.com/repos/outsideris/mocha/statuses/{sha}","languages_url":"https://api.github.com/repos/outsideris/mocha/languages","stargazers_url":"https://api.github.com/repos/outsideris/mocha/stargazers","contributors_url":"https://api.github.com/repos/outsideris/mocha/contributors","subscribers_url":"https://api.github.com/repos/outsideris/mocha/subscribers","subscription_url":"https://api.github.com/repos/outsideris/mocha/subscription","commits_url":"https://api.github.com/repos/outsideris/mocha/commits{/sha}","git_commits_url":"https://api.github.com/repos/outsideris/mocha/git/commits{/sha}","comments_url":"https://api.github.com/repos/outsideris/mocha/comments{/number}","issue_comment_url":"https://api.github.com/repos/outsideris/mocha/issues/comments{/number}","contents_url":"https://api.github.com/repos/outsideris/mocha/contents/{+path}","compare_url":"https://api.github.com/repos/outsideris/mocha/compare/{base}...{head}","merges_url":"https://api.github.com/repos/outsideris/mocha/merges","archive_url":"https://api.github.com/repos/outsideris/mocha/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/outsideris/mocha/downloads","issues_url":"https://api.github.com/repos/outsideris/mocha/issues{/number}","pulls_url":"https://api.github.com/repos/outsideris/mocha/pulls{/number}","milestones_url":"https://api.github.com/repos/outsideris/mocha/milestones{/number}","notifications_url":"https://api.github.com/repos/outsideris/mocha/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/outsideris/mocha/labels{/name}","releases_url":"https://api.github.com/repos/outsideris/mocha/releases{/id}","deployments_url":"https://api.github.com/repos/outsideris/mocha/deployments","created_at":"2015-08-16T11:49:40Z","updated_at":"2018-06-07T03:59:54Z","pushed_at":"2018-10-01T18:44:12Z","git_url":"git://github.com/outsideris/mocha.git","ssh_url":"git@github.com:outsideris/mocha.git","clone_url":"https://github.com/outsideris/mocha.git","svn_url":"https://github.com/outsideris/mocha","homepage":"http://mochajs.org","size":9069,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":1,"watchers":1,"default_branch":"outsideris"}},"base":{"label":"mochajs:master","ref":"master","sha":"04469bf0e3a008be9d066835fad278a542d8232a","user":{"login":"mochajs","id":8770005,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg3NzAwMDU=","avatar_url":"https://avatars2.githubusercontent.com/u/8770005?v=4","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,"node_id":"MDEwOlJlcG9zaXRvcnkxNDUxMzUy","name":"mocha","full_name":"mochajs/mocha","private":false,"owner":{"login":"mochajs","id":8770005,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg3NzAwMDU=","avatar_url":"https://avatars2.githubusercontent.com/u/8770005?v=4","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},"html_url":"https://github.com/mochajs/mocha","description":"☕️ 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":"2018-10-02T01:48:03Z","pushed_at":"2018-10-01T21:53:41Z","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":"https://mochajs.org","size":9792,"stargazers_count":16320,"watchers_count":16320,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2229,"mirror_url":null,"archived":false,"open_issues_count":303,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":2229,"open_issues":303,"watchers":16320,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mochajs/mocha/pulls/3486"},"html":{"href":"https://github.com/mochajs/mocha/pull/3486"},"issue":{"href":"https://api.github.com/repos/mochajs/mocha/issues/3486"},"comments":{"href":"https://api.github.com/repos/mochajs/mocha/issues/3486/comments"},"review_comments":{"href":"https://api.github.com/repos/mochajs/mocha/pulls/3486/comments"},"review_comment":{"href":"https://api.github.com/repos/mochajs/mocha/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mochajs/mocha/pulls/3486/commits"},"statuses":{"href":"https://api.github.com/repos/mochajs/mocha/statuses/3a3c8d796646e14830763fca15a8f12079165a15"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"plroebuck"}}