{"action":"created","comment":{"url":"https://api.github.com/repos/facebook/jest/pulls/comments/93286060","pull_request_review_id":13810520,"id":93286060,"diff_hunk":"@@ -0,0 +1,215 @@\n+/**\n+ * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n+ *\n+ * This source code is licensed under the BSD-style license found in the\n+ * LICENSE file in the root directory of this source tree. An additional grant\n+ * of patent rights can be found in the PATENTS file in the same directory.\n+ *\n+ * @flow\n+ */\n+'use strict';\n+\n+import type {HasteContext} from 'types/HasteMap';\n+\n+const realFs = require('fs');\n+const fs = require('graceful-fs');\n+fs.gracefulify(realFs);\n+\n+const {clearLine} = require('jest-util');\n+const Runtime = require('jest-runtime');\n+const ansiEscapes = require('ansi-escapes');\n+const chalk = require('chalk');\n+const preRunMessage = require('./preRunMessage');\n+const TestWatcher = require('./TestWatcher');\n+const runJest = require('./runJest');\n+const setWatchMode = require('./lib/setWatchMode');\n+const HasteMap = require('jest-haste-map');","path":"packages/jest-cli/src/watch.js","position":26,"original_position":26,"commit_id":"581cd58c019dcdee37bd4bafa6adfba37ac3403c","original_commit_id":"581cd58c019dcdee37bd4bafa6adfba37ac3403c","user":{"login":"cpojer","id":13352,"avatar_url":"https://avatars.githubusercontent.com/u/13352?v=3","gravatar_id":"","url":"https://api.github.com/users/cpojer","html_url":"https://github.com/cpojer","followers_url":"https://api.github.com/users/cpojer/followers","following_url":"https://api.github.com/users/cpojer/following{/other_user}","gists_url":"https://api.github.com/users/cpojer/gists{/gist_id}","starred_url":"https://api.github.com/users/cpojer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpojer/subscriptions","organizations_url":"https://api.github.com/users/cpojer/orgs","repos_url":"https://api.github.com/users/cpojer/repos","events_url":"https://api.github.com/users/cpojer/events{/privacy}","received_events_url":"https://api.github.com/users/cpojer/received_events","type":"User","site_admin":false},"body":"can you sort these alphabetically?","created_at":"2016-12-20T17:31:29Z","updated_at":"2016-12-20T17:31:29Z","html_url":"https://github.com/facebook/jest/pull/2362#discussion_r93286060","pull_request_url":"https://api.github.com/repos/facebook/jest/pulls/2362","_links":{"self":{"href":"https://api.github.com/repos/facebook/jest/pulls/comments/93286060"},"html":{"href":"https://github.com/facebook/jest/pull/2362#discussion_r93286060"},"pull_request":{"href":"https://api.github.com/repos/facebook/jest/pulls/2362"}}},"pull_request":{"url":"https://api.github.com/repos/facebook/jest/pulls/2362","id":98614482,"html_url":"https://github.com/facebook/jest/pull/2362","diff_url":"https://github.com/facebook/jest/pull/2362.diff","patch_url":"https://github.com/facebook/jest/pull/2362.patch","issue_url":"https://api.github.com/repos/facebook/jest/issues/2362","number":2362,"state":"open","locked":false,"title":"Extract watch mode","user":{"login":"rogeliog","id":574806,"avatar_url":"https://avatars.githubusercontent.com/u/574806?v=3","gravatar_id":"","url":"https://api.github.com/users/rogeliog","html_url":"https://github.com/rogeliog","followers_url":"https://api.github.com/users/rogeliog/followers","following_url":"https://api.github.com/users/rogeliog/following{/other_user}","gists_url":"https://api.github.com/users/rogeliog/gists{/gist_id}","starred_url":"https://api.github.com/users/rogeliog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rogeliog/subscriptions","organizations_url":"https://api.github.com/users/rogeliog/orgs","repos_url":"https://api.github.com/users/rogeliog/repos","events_url":"https://api.github.com/users/rogeliog/events{/privacy}","received_events_url":"https://api.github.com/users/rogeliog/received_events","type":"User","site_admin":false},"body":"**Summary**\r\n\r\nThis extracts the watch mode to its own module, which was suggested by @cpojer as a prerequisite for #2324.\r\n\r\nThis should make watch mode faster and removes some duplicated code from `jest.js`.\r\nNow we only need to reconcile with the file system only when a file is added/removed, but not otherwise\r\n\r\nMore info https://github.com/facebook/jest/pull/2324#issuecomment-267149669 I hope that this will also allow us to add more tests in the future.\r\n\r\n**Known issues:**\r\n\r\nTest interruption is not working and I'm not sure why. It seems that I'm setting the correct state in the `TestWatcher` :(\r\n![interrupt](https://cloud.githubusercontent.com/assets/574806/21323938/858ed494-c5d4-11e6-8878-295773a7307f.gif)\r\n\r\n","created_at":"2016-12-19T18:20:35Z","updated_at":"2016-12-20T17:31:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4f76e2c31751e4f25704177ee263f96d645a27f9","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/facebook/jest/pulls/2362/commits","review_comments_url":"https://api.github.com/repos/facebook/jest/pulls/2362/comments","review_comment_url":"https://api.github.com/repos/facebook/jest/pulls/comments{/number}","comments_url":"https://api.github.com/repos/facebook/jest/issues/2362/comments","statuses_url":"https://api.github.com/repos/facebook/jest/statuses/581cd58c019dcdee37bd4bafa6adfba37ac3403c","head":{"label":"rogeliog:extract-watch","ref":"extract-watch","sha":"581cd58c019dcdee37bd4bafa6adfba37ac3403c","user":{"login":"rogeliog","id":574806,"avatar_url":"https://avatars.githubusercontent.com/u/574806?v=3","gravatar_id":"","url":"https://api.github.com/users/rogeliog","html_url":"https://github.com/rogeliog","followers_url":"https://api.github.com/users/rogeliog/followers","following_url":"https://api.github.com/users/rogeliog/following{/other_user}","gists_url":"https://api.github.com/users/rogeliog/gists{/gist_id}","starred_url":"https://api.github.com/users/rogeliog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rogeliog/subscriptions","organizations_url":"https://api.github.com/users/rogeliog/orgs","repos_url":"https://api.github.com/users/rogeliog/repos","events_url":"https://api.github.com/users/rogeliog/events{/privacy}","received_events_url":"https://api.github.com/users/rogeliog/received_events","type":"User","site_admin":false},"repo":{"id":71920651,"name":"jest","full_name":"rogeliog/jest","owner":{"login":"rogeliog","id":574806,"avatar_url":"https://avatars.githubusercontent.com/u/574806?v=3","gravatar_id":"","url":"https://api.github.com/users/rogeliog","html_url":"https://github.com/rogeliog","followers_url":"https://api.github.com/users/rogeliog/followers","following_url":"https://api.github.com/users/rogeliog/following{/other_user}","gists_url":"https://api.github.com/users/rogeliog/gists{/gist_id}","starred_url":"https://api.github.com/users/rogeliog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rogeliog/subscriptions","organizations_url":"https://api.github.com/users/rogeliog/orgs","repos_url":"https://api.github.com/users/rogeliog/repos","events_url":"https://api.github.com/users/rogeliog/events{/privacy}","received_events_url":"https://api.github.com/users/rogeliog/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rogeliog/jest","description":"🃏 Painless JavaScript Testing.","fork":true,"url":"https://api.github.com/repos/rogeliog/jest","forks_url":"https://api.github.com/repos/rogeliog/jest/forks","keys_url":"https://api.github.com/repos/rogeliog/jest/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rogeliog/jest/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rogeliog/jest/teams","hooks_url":"https://api.github.com/repos/rogeliog/jest/hooks","issue_events_url":"https://api.github.com/repos/rogeliog/jest/issues/events{/number}","events_url":"https://api.github.com/repos/rogeliog/jest/events","assignees_url":"https://api.github.com/repos/rogeliog/jest/assignees{/user}","branches_url":"https://api.github.com/repos/rogeliog/jest/branches{/branch}","tags_url":"https://api.github.com/repos/rogeliog/jest/tags","blobs_url":"https://api.github.com/repos/rogeliog/jest/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rogeliog/jest/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rogeliog/jest/git/refs{/sha}","trees_url":"https://api.github.com/repos/rogeliog/jest/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rogeliog/jest/statuses/{sha}","languages_url":"https://api.github.com/repos/rogeliog/jest/languages","stargazers_url":"https://api.github.com/repos/rogeliog/jest/stargazers","contributors_url":"https://api.github.com/repos/rogeliog/jest/contributors","subscribers_url":"https://api.github.com/repos/rogeliog/jest/subscribers","subscription_url":"https://api.github.com/repos/rogeliog/jest/subscription","commits_url":"https://api.github.com/repos/rogeliog/jest/commits{/sha}","git_commits_url":"https://api.github.com/repos/rogeliog/jest/git/commits{/sha}","comments_url":"https://api.github.com/repos/rogeliog/jest/comments{/number}","issue_comment_url":"https://api.github.com/repos/rogeliog/jest/issues/comments{/number}","contents_url":"https://api.github.com/repos/rogeliog/jest/contents/{+path}","compare_url":"https://api.github.com/repos/rogeliog/jest/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rogeliog/jest/merges","archive_url":"https://api.github.com/repos/rogeliog/jest/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rogeliog/jest/downloads","issues_url":"https://api.github.com/repos/rogeliog/jest/issues{/number}","pulls_url":"https://api.github.com/repos/rogeliog/jest/pulls{/number}","milestones_url":"https://api.github.com/repos/rogeliog/jest/milestones{/number}","notifications_url":"https://api.github.com/repos/rogeliog/jest/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rogeliog/jest/labels{/name}","releases_url":"https://api.github.com/repos/rogeliog/jest/releases{/id}","deployments_url":"https://api.github.com/repos/rogeliog/jest/deployments","created_at":"2016-10-25T17:13:15Z","updated_at":"2016-10-25T17:13:17Z","pushed_at":"2016-12-19T18:54:19Z","git_url":"git://github.com/rogeliog/jest.git","ssh_url":"git@github.com:rogeliog/jest.git","clone_url":"https://github.com/rogeliog/jest.git","svn_url":"https://github.com/rogeliog/jest","homepage":"http://facebook.github.io/jest/","size":8904,"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":"facebook:master","ref":"master","sha":"e7755a30d3e306e721052372bc71a266d58935fa","user":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"repo":{"id":15062869,"name":"jest","full_name":"facebook/jest","owner":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/facebook/jest","description":"🃏 Painless JavaScript Testing.","fork":false,"url":"https://api.github.com/repos/facebook/jest","forks_url":"https://api.github.com/repos/facebook/jest/forks","keys_url":"https://api.github.com/repos/facebook/jest/keys{/key_id}","collaborators_url":"https://api.github.com/repos/facebook/jest/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/facebook/jest/teams","hooks_url":"https://api.github.com/repos/facebook/jest/hooks","issue_events_url":"https://api.github.com/repos/facebook/jest/issues/events{/number}","events_url":"https://api.github.com/repos/facebook/jest/events","assignees_url":"https://api.github.com/repos/facebook/jest/assignees{/user}","branches_url":"https://api.github.com/repos/facebook/jest/branches{/branch}","tags_url":"https://api.github.com/repos/facebook/jest/tags","blobs_url":"https://api.github.com/repos/facebook/jest/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/facebook/jest/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/facebook/jest/git/refs{/sha}","trees_url":"https://api.github.com/repos/facebook/jest/git/trees{/sha}","statuses_url":"https://api.github.com/repos/facebook/jest/statuses/{sha}","languages_url":"https://api.github.com/repos/facebook/jest/languages","stargazers_url":"https://api.github.com/repos/facebook/jest/stargazers","contributors_url":"https://api.github.com/repos/facebook/jest/contributors","subscribers_url":"https://api.github.com/repos/facebook/jest/subscribers","subscription_url":"https://api.github.com/repos/facebook/jest/subscription","commits_url":"https://api.github.com/repos/facebook/jest/commits{/sha}","git_commits_url":"https://api.github.com/repos/facebook/jest/git/commits{/sha}","comments_url":"https://api.github.com/repos/facebook/jest/comments{/number}","issue_comment_url":"https://api.github.com/repos/facebook/jest/issues/comments{/number}","contents_url":"https://api.github.com/repos/facebook/jest/contents/{+path}","compare_url":"https://api.github.com/repos/facebook/jest/compare/{base}...{head}","merges_url":"https://api.github.com/repos/facebook/jest/merges","archive_url":"https://api.github.com/repos/facebook/jest/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/facebook/jest/downloads","issues_url":"https://api.github.com/repos/facebook/jest/issues{/number}","pulls_url":"https://api.github.com/repos/facebook/jest/pulls{/number}","milestones_url":"https://api.github.com/repos/facebook/jest/milestones{/number}","notifications_url":"https://api.github.com/repos/facebook/jest/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/facebook/jest/labels{/name}","releases_url":"https://api.github.com/repos/facebook/jest/releases{/id}","deployments_url":"https://api.github.com/repos/facebook/jest/deployments","created_at":"2013-12-10T00:18:04Z","updated_at":"2016-12-20T17:09:33Z","pushed_at":"2016-12-20T16:30:32Z","git_url":"git://github.com/facebook/jest.git","ssh_url":"git@github.com:facebook/jest.git","clone_url":"https://github.com/facebook/jest.git","svn_url":"https://github.com/facebook/jest","homepage":"http://facebook.github.io/jest/","size":9006,"stargazers_count":7169,"watchers_count":7169,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":856,"mirror_url":null,"open_issues_count":119,"forks":856,"open_issues":119,"watchers":7169,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/facebook/jest/pulls/2362"},"html":{"href":"https://github.com/facebook/jest/pull/2362"},"issue":{"href":"https://api.github.com/repos/facebook/jest/issues/2362"},"comments":{"href":"https://api.github.com/repos/facebook/jest/issues/2362/comments"},"review_comments":{"href":"https://api.github.com/repos/facebook/jest/pulls/2362/comments"},"review_comment":{"href":"https://api.github.com/repos/facebook/jest/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/facebook/jest/pulls/2362/commits"},"statuses":{"href":"https://api.github.com/repos/facebook/jest/statuses/581cd58c019dcdee37bd4bafa6adfba37ac3403c"}}}}
{"actor":{"display_login":"cpojer"}}