{"action":"created","comment":{"url":"https://api.github.com/repos/jest-community/vscode-jest/pulls/comments/191050610","pull_request_review_id":123558745,"id":191050610,"diff_hunk":"@@ -56,29 +56,32 @@ function hasNodeExecutable(rootPath: string, executable: string): boolean {\n }\n \n /**\n- *  Handles getting the jest runner, handling the OS and project specific work too\n+ * Handles getting the jest runner, handling the OS and project specific work too\n  *\n  * @returns {string}\n  */\n-export function pathToJest(pluginSettings: IPluginSettings) {\n-  if (pluginSettings.pathToJest) {\n-    if (isBootstrappedWithCRA(pluginSettings.rootPath)) {\n-      return 'npm test --'\n-    }\n-    return normalize(pluginSettings.pathToJest)\n+export function pathToJest({ pathToJest, rootPath }: IPluginSettings) {\n+  if (isNotDefaultPathToJest(pathToJest)) {\n+    return normalize(pathToJest)\n   }\n \n-  const platform = process.platform\n-  if (platform === 'win32' && existsSync(join(pluginSettings.rootPath, 'node_modules', '.bin', 'jest.cmd'))) {\n-    return normalize(join(pluginSettings.rootPath, 'node_modules', '.bin', 'jest.cmd'))\n-  } else if (\n-    (platform === 'linux' || platform === 'darwin') &&\n-    existsSync(join(pluginSettings.rootPath, 'node_modules', '.bin', 'jest'))\n-  ) {\n-    return normalize(join(pluginSettings.rootPath, 'node_modules', '.bin', 'jest'))\n+  if (isBootstrappedWithCreateReactApp(rootPath)) {\n+    return 'npm test --'","path":"src/helpers.ts","position":76,"original_position":76,"commit_id":"ff459165ab600809ac230d7e6fddfbb2d878be90","original_commit_id":"ff459165ab600809ac230d7e6fddfbb2d878be90","user":{"login":"stephtr","id":5764184,"avatar_url":"https://avatars1.githubusercontent.com/u/5764184?v=4","gravatar_id":"","url":"https://api.github.com/users/stephtr","html_url":"https://github.com/stephtr","followers_url":"https://api.github.com/users/stephtr/followers","following_url":"https://api.github.com/users/stephtr/following{/other_user}","gists_url":"https://api.github.com/users/stephtr/gists{/gist_id}","starred_url":"https://api.github.com/users/stephtr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephtr/subscriptions","organizations_url":"https://api.github.com/users/stephtr/orgs","repos_url":"https://api.github.com/users/stephtr/repos","events_url":"https://api.github.com/users/stephtr/events{/privacy}","received_events_url":"https://api.github.com/users/stephtr/received_events","type":"User","site_admin":false},"body":"Shouldn't we here also add the `.cmd` file extension on Windows? (at least until #297 hopefully solves all extension related issues)","created_at":"2018-05-26T14:42:28Z","updated_at":"2018-05-26T14:42:28Z","html_url":"https://github.com/jest-community/vscode-jest/pull/332#discussion_r191050610","pull_request_url":"https://api.github.com/repos/jest-community/vscode-jest/pulls/332","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/jest-community/vscode-jest/pulls/comments/191050610"},"html":{"href":"https://github.com/jest-community/vscode-jest/pull/332#discussion_r191050610"},"pull_request":{"href":"https://api.github.com/repos/jest-community/vscode-jest/pulls/332"}}},"pull_request":{"url":"https://api.github.com/repos/jest-community/vscode-jest/pulls/332","id":189542074,"html_url":"https://github.com/jest-community/vscode-jest/pull/332","diff_url":"https://github.com/jest-community/vscode-jest/pull/332.diff","patch_url":"https://github.com/jest-community/vscode-jest/pull/332.patch","issue_url":"https://api.github.com/repos/jest-community/vscode-jest/issues/332","number":332,"state":"open","locked":false,"title":"Fix regression detecting create-react-app","user":{"login":"seanpoulter","id":2585460,"avatar_url":"https://avatars0.githubusercontent.com/u/2585460?v=4","gravatar_id":"","url":"https://api.github.com/users/seanpoulter","html_url":"https://github.com/seanpoulter","followers_url":"https://api.github.com/users/seanpoulter/followers","following_url":"https://api.github.com/users/seanpoulter/following{/other_user}","gists_url":"https://api.github.com/users/seanpoulter/gists{/gist_id}","starred_url":"https://api.github.com/users/seanpoulter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seanpoulter/subscriptions","organizations_url":"https://api.github.com/users/seanpoulter/orgs","repos_url":"https://api.github.com/users/seanpoulter/repos","events_url":"https://api.github.com/users/seanpoulter/events{/privacy}","received_events_url":"https://api.github.com/users/seanpoulter/received_events","type":"User","site_admin":false},"body":"As discussed in Issue #313 and the comments on PR #324, we've introduced a regression that broke support for create-react-app out of the box.\r\n\r\nChanges proposed in this PR:\r\n* This changes when we check if the workspace was bootstrapped with create-react-app. We've recently changed the default value for `pathToJest` to `null` so the following check would only be performed if the user has changed their settings. This caused new bootstrapped projects to run with `jest` instead of indirectly calling `react-scripts test` via `npm test --`.\r\n\r\n    The following caused the regression:\r\n    ```js\r\n       if (pluginSettings.pathToJest) {\t\r\n        if (isBootstrappedWithCRA(pluginSettings.rootPath)) {\t\r\n    ```\r\n\r\nTesting plan:\r\n* Tested on OSX without issue\r\n* Added tests for `pathToJest` to capture recent changes including defaulting to global Jest","created_at":"2018-05-22T03:59:37Z","updated_at":"2018-05-26T14:42:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5bbf80a835c6145c3bd3ea5c97f153a580baaa64","assignee":null,"assignees":[],"requested_reviewers":[{"login":"orta","id":49038,"avatar_url":"https://avatars2.githubusercontent.com/u/49038?v=4","gravatar_id":"","url":"https://api.github.com/users/orta","html_url":"https://github.com/orta","followers_url":"https://api.github.com/users/orta/followers","following_url":"https://api.github.com/users/orta/following{/other_user}","gists_url":"https://api.github.com/users/orta/gists{/gist_id}","starred_url":"https://api.github.com/users/orta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/orta/subscriptions","organizations_url":"https://api.github.com/users/orta/orgs","repos_url":"https://api.github.com/users/orta/repos","events_url":"https://api.github.com/users/orta/events{/privacy}","received_events_url":"https://api.github.com/users/orta/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":817000288,"url":"https://api.github.com/repos/jest-community/vscode-jest/labels/stage:%20needs%20review","name":"stage: needs review","color":"eff7ff","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/jest-community/vscode-jest/pulls/332/commits","review_comments_url":"https://api.github.com/repos/jest-community/vscode-jest/pulls/332/comments","review_comment_url":"https://api.github.com/repos/jest-community/vscode-jest/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jest-community/vscode-jest/issues/332/comments","statuses_url":"https://api.github.com/repos/jest-community/vscode-jest/statuses/ff459165ab600809ac230d7e6fddfbb2d878be90","head":{"label":"seanpoulter:feature/#313/Fix-regression-in-support-for-react-scripts","ref":"feature/#313/Fix-regression-in-support-for-react-scripts","sha":"ff459165ab600809ac230d7e6fddfbb2d878be90","user":{"login":"seanpoulter","id":2585460,"avatar_url":"https://avatars0.githubusercontent.com/u/2585460?v=4","gravatar_id":"","url":"https://api.github.com/users/seanpoulter","html_url":"https://github.com/seanpoulter","followers_url":"https://api.github.com/users/seanpoulter/followers","following_url":"https://api.github.com/users/seanpoulter/following{/other_user}","gists_url":"https://api.github.com/users/seanpoulter/gists{/gist_id}","starred_url":"https://api.github.com/users/seanpoulter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seanpoulter/subscriptions","organizations_url":"https://api.github.com/users/seanpoulter/orgs","repos_url":"https://api.github.com/users/seanpoulter/repos","events_url":"https://api.github.com/users/seanpoulter/events{/privacy}","received_events_url":"https://api.github.com/users/seanpoulter/received_events","type":"User","site_admin":false},"repo":{"id":108594651,"name":"vscode-jest","full_name":"seanpoulter/vscode-jest","owner":{"login":"seanpoulter","id":2585460,"avatar_url":"https://avatars0.githubusercontent.com/u/2585460?v=4","gravatar_id":"","url":"https://api.github.com/users/seanpoulter","html_url":"https://github.com/seanpoulter","followers_url":"https://api.github.com/users/seanpoulter/followers","following_url":"https://api.github.com/users/seanpoulter/following{/other_user}","gists_url":"https://api.github.com/users/seanpoulter/gists{/gist_id}","starred_url":"https://api.github.com/users/seanpoulter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seanpoulter/subscriptions","organizations_url":"https://api.github.com/users/seanpoulter/orgs","repos_url":"https://api.github.com/users/seanpoulter/repos","events_url":"https://api.github.com/users/seanpoulter/events{/privacy}","received_events_url":"https://api.github.com/users/seanpoulter/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/seanpoulter/vscode-jest","description":"The optimal flow for Jest based testing in VS Code","fork":true,"url":"https://api.github.com/repos/seanpoulter/vscode-jest","forks_url":"https://api.github.com/repos/seanpoulter/vscode-jest/forks","keys_url":"https://api.github.com/repos/seanpoulter/vscode-jest/keys{/key_id}","collaborators_url":"https://api.github.com/repos/seanpoulter/vscode-jest/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/seanpoulter/vscode-jest/teams","hooks_url":"https://api.github.com/repos/seanpoulter/vscode-jest/hooks","issue_events_url":"https://api.github.com/repos/seanpoulter/vscode-jest/issues/events{/number}","events_url":"https://api.github.com/repos/seanpoulter/vscode-jest/events","assignees_url":"https://api.github.com/repos/seanpoulter/vscode-jest/assignees{/user}","branches_url":"https://api.github.com/repos/seanpoulter/vscode-jest/branches{/branch}","tags_url":"https://api.github.com/repos/seanpoulter/vscode-jest/tags","blobs_url":"https://api.github.com/repos/seanpoulter/vscode-jest/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/seanpoulter/vscode-jest/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/seanpoulter/vscode-jest/git/refs{/sha}","trees_url":"https://api.github.com/repos/seanpoulter/vscode-jest/git/trees{/sha}","statuses_url":"https://api.github.com/repos/seanpoulter/vscode-jest/statuses/{sha}","languages_url":"https://api.github.com/repos/seanpoulter/vscode-jest/languages","stargazers_url":"https://api.github.com/repos/seanpoulter/vscode-jest/stargazers","contributors_url":"https://api.github.com/repos/seanpoulter/vscode-jest/contributors","subscribers_url":"https://api.github.com/repos/seanpoulter/vscode-jest/subscribers","subscription_url":"https://api.github.com/repos/seanpoulter/vscode-jest/subscription","commits_url":"https://api.github.com/repos/seanpoulter/vscode-jest/commits{/sha}","git_commits_url":"https://api.github.com/repos/seanpoulter/vscode-jest/git/commits{/sha}","comments_url":"https://api.github.com/repos/seanpoulter/vscode-jest/comments{/number}","issue_comment_url":"https://api.github.com/repos/seanpoulter/vscode-jest/issues/comments{/number}","contents_url":"https://api.github.com/repos/seanpoulter/vscode-jest/contents/{+path}","compare_url":"https://api.github.com/repos/seanpoulter/vscode-jest/compare/{base}...{head}","merges_url":"https://api.github.com/repos/seanpoulter/vscode-jest/merges","archive_url":"https://api.github.com/repos/seanpoulter/vscode-jest/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/seanpoulter/vscode-jest/downloads","issues_url":"https://api.github.com/repos/seanpoulter/vscode-jest/issues{/number}","pulls_url":"https://api.github.com/repos/seanpoulter/vscode-jest/pulls{/number}","milestones_url":"https://api.github.com/repos/seanpoulter/vscode-jest/milestones{/number}","notifications_url":"https://api.github.com/repos/seanpoulter/vscode-jest/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/seanpoulter/vscode-jest/labels{/name}","releases_url":"https://api.github.com/repos/seanpoulter/vscode-jest/releases{/id}","deployments_url":"https://api.github.com/repos/seanpoulter/vscode-jest/deployments","created_at":"2017-10-27T20:53:07Z","updated_at":"2018-03-30T18:23:48Z","pushed_at":"2018-05-23T02:18:59Z","git_url":"git://github.com/seanpoulter/vscode-jest.git","ssh_url":"git@github.com:seanpoulter/vscode-jest.git","clone_url":"https://github.com/seanpoulter/vscode-jest.git","svn_url":"https://github.com/seanpoulter/vscode-jest","homepage":null,"size":5233,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jest-community:master","ref":"master","sha":"293f97712e8a4548533d15d962cb3580e456998f","user":{"login":"jest-community","id":32196900,"avatar_url":"https://avatars0.githubusercontent.com/u/32196900?v=4","gravatar_id":"","url":"https://api.github.com/users/jest-community","html_url":"https://github.com/jest-community","followers_url":"https://api.github.com/users/jest-community/followers","following_url":"https://api.github.com/users/jest-community/following{/other_user}","gists_url":"https://api.github.com/users/jest-community/gists{/gist_id}","starred_url":"https://api.github.com/users/jest-community/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jest-community/subscriptions","organizations_url":"https://api.github.com/users/jest-community/orgs","repos_url":"https://api.github.com/users/jest-community/repos","events_url":"https://api.github.com/users/jest-community/events{/privacy}","received_events_url":"https://api.github.com/users/jest-community/received_events","type":"Organization","site_admin":false},"repo":{"id":70403530,"name":"vscode-jest","full_name":"jest-community/vscode-jest","owner":{"login":"jest-community","id":32196900,"avatar_url":"https://avatars0.githubusercontent.com/u/32196900?v=4","gravatar_id":"","url":"https://api.github.com/users/jest-community","html_url":"https://github.com/jest-community","followers_url":"https://api.github.com/users/jest-community/followers","following_url":"https://api.github.com/users/jest-community/following{/other_user}","gists_url":"https://api.github.com/users/jest-community/gists{/gist_id}","starred_url":"https://api.github.com/users/jest-community/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jest-community/subscriptions","organizations_url":"https://api.github.com/users/jest-community/orgs","repos_url":"https://api.github.com/users/jest-community/repos","events_url":"https://api.github.com/users/jest-community/events{/privacy}","received_events_url":"https://api.github.com/users/jest-community/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jest-community/vscode-jest","description":"The optimal flow for Jest based testing in VS Code","fork":false,"url":"https://api.github.com/repos/jest-community/vscode-jest","forks_url":"https://api.github.com/repos/jest-community/vscode-jest/forks","keys_url":"https://api.github.com/repos/jest-community/vscode-jest/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jest-community/vscode-jest/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jest-community/vscode-jest/teams","hooks_url":"https://api.github.com/repos/jest-community/vscode-jest/hooks","issue_events_url":"https://api.github.com/repos/jest-community/vscode-jest/issues/events{/number}","events_url":"https://api.github.com/repos/jest-community/vscode-jest/events","assignees_url":"https://api.github.com/repos/jest-community/vscode-jest/assignees{/user}","branches_url":"https://api.github.com/repos/jest-community/vscode-jest/branches{/branch}","tags_url":"https://api.github.com/repos/jest-community/vscode-jest/tags","blobs_url":"https://api.github.com/repos/jest-community/vscode-jest/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jest-community/vscode-jest/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jest-community/vscode-jest/git/refs{/sha}","trees_url":"https://api.github.com/repos/jest-community/vscode-jest/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jest-community/vscode-jest/statuses/{sha}","languages_url":"https://api.github.com/repos/jest-community/vscode-jest/languages","stargazers_url":"https://api.github.com/repos/jest-community/vscode-jest/stargazers","contributors_url":"https://api.github.com/repos/jest-community/vscode-jest/contributors","subscribers_url":"https://api.github.com/repos/jest-community/vscode-jest/subscribers","subscription_url":"https://api.github.com/repos/jest-community/vscode-jest/subscription","commits_url":"https://api.github.com/repos/jest-community/vscode-jest/commits{/sha}","git_commits_url":"https://api.github.com/repos/jest-community/vscode-jest/git/commits{/sha}","comments_url":"https://api.github.com/repos/jest-community/vscode-jest/comments{/number}","issue_comment_url":"https://api.github.com/repos/jest-community/vscode-jest/issues/comments{/number}","contents_url":"https://api.github.com/repos/jest-community/vscode-jest/contents/{+path}","compare_url":"https://api.github.com/repos/jest-community/vscode-jest/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jest-community/vscode-jest/merges","archive_url":"https://api.github.com/repos/jest-community/vscode-jest/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jest-community/vscode-jest/downloads","issues_url":"https://api.github.com/repos/jest-community/vscode-jest/issues{/number}","pulls_url":"https://api.github.com/repos/jest-community/vscode-jest/pulls{/number}","milestones_url":"https://api.github.com/repos/jest-community/vscode-jest/milestones{/number}","notifications_url":"https://api.github.com/repos/jest-community/vscode-jest/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jest-community/vscode-jest/labels{/name}","releases_url":"https://api.github.com/repos/jest-community/vscode-jest/releases{/id}","deployments_url":"https://api.github.com/repos/jest-community/vscode-jest/deployments","created_at":"2016-10-09T13:06:02Z","updated_at":"2018-05-26T01:13:20Z","pushed_at":"2018-05-23T12:28:53Z","git_url":"git://github.com/jest-community/vscode-jest.git","ssh_url":"git@github.com:jest-community/vscode-jest.git","clone_url":"https://github.com/jest-community/vscode-jest.git","svn_url":"https://github.com/jest-community/vscode-jest","homepage":null,"size":5248,"stargazers_count":792,"watchers_count":792,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":54,"mirror_url":null,"archived":false,"open_issues_count":83,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":54,"open_issues":83,"watchers":792,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jest-community/vscode-jest/pulls/332"},"html":{"href":"https://github.com/jest-community/vscode-jest/pull/332"},"issue":{"href":"https://api.github.com/repos/jest-community/vscode-jest/issues/332"},"comments":{"href":"https://api.github.com/repos/jest-community/vscode-jest/issues/332/comments"},"review_comments":{"href":"https://api.github.com/repos/jest-community/vscode-jest/pulls/332/comments"},"review_comment":{"href":"https://api.github.com/repos/jest-community/vscode-jest/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jest-community/vscode-jest/pulls/332/commits"},"statuses":{"href":"https://api.github.com/repos/jest-community/vscode-jest/statuses/ff459165ab600809ac230d7e6fddfbb2d878be90"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"stephtr"}}