{"action":"created","comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/pulls/comments/150254926","pull_request_review_id":75777616,"id":150254926,"diff_hunk":"@@ -36,32 +39,88 @@ abstract class ExternalCompileRunnerBase extends RunnerBase {\n                     if (install.status !== 0) throw new Error(`NPM Install for ${directoryName} failed!`);\r\n                 }\r\n                 Harness.Baseline.runBaseline(`${this.kind()}/${directoryName}.log`, () => {\r\n-                    const result = cp.spawnSync(`node`, [path.join(__dirname, \"tsc.js\")], { cwd, timeout, shell: true });\r\n-                    // tslint:disable-next-line:no-null-keyword\r\n-                    return result.status === 0 && !result.stdout.length && !result.stderr.length ? null : `Exit Code: ${result.status}\r\n-Standard output:\r\n-${result.stdout.toString().replace(/\\r\\n/g, \"\\n\")}\r\n-\r\n-\r\n-Standard error:\r\n-${result.stderr.toString().replace(/\\r\\n/g, \"\\n\")}`;\r\n+                    return this.report(cp.spawnSync(`node`, [path.join(__dirname, \"tsc.js\")], { cwd, timeout, shell: true }), cwd);\r\n                 });\r\n             });\r\n         });\r\n     }\r\n }\r\n \r\n class UserCodeRunner extends ExternalCompileRunnerBase {\r\n-    public readonly testDir = \"tests/cases/user/\";\r\n-    public kind(): TestRunnerKind {\r\n+    readonly testDir = \"tests/cases/user/\";\r\n+    kind(): TestRunnerKind {\r\n         return \"user\";\r\n     }\r\n+    report(result: any) {\r\n+        // tslint:disable-next-line:no-null-keyword\r\n+        return result.status === 0 && !result.stdout.length && !result.stderr.length ? null : `Exit Code: ${result.status}\r\n+Standard output:\r\n+${result.stdout.toString().replace(/\\r\\n/g, \"\\n\")}\r\n+\r\n+\r\n+Standard error:\r\n+${result.stderr.toString().replace(/\\r\\n/g, \"\\n\")}`;\r\n+    }\r\n }\r\n \r\n class DefinitelyTypedRunner extends ExternalCompileRunnerBase {\r\n-    public readonly testDir = \"../DefinitelyTyped/types/\";\r\n-    public workingDirectory = this.testDir;\r\n-    public kind(): TestRunnerKind {\r\n+    readonly testDir = \"../DefinitelyTyped/types/\";\r\n+    workingDirectory = this.testDir;\r\n+    kind(): TestRunnerKind {\r\n         return \"dt\";\r\n     }\r\n+    report(result: any, cwd: string) {\r\n+        const stdout = filterExpectedErrors(result.stdout.toString(), cwd)\r\n+        const stderr = result.stderr.toString()\r\n+        // tslint:disable-next-line:no-null-keyword\r\n+        return !stdout.length && !stderr.length ? null : `Exit Code: ${result.status}\r\n+Standard output:\r\n+${stdout.replace(/\\r\\n/g, \"\\n\")}\r\n+\r\n+\r\n+Standard error:\r\n+${stderr.replace(/\\r\\n/g, \"\\n\")}`;\r\n+    }\r\n+}\r\n+\r\n+function filterExpectedErrors(errors: string, cwd: string): string {\r\n+    return breaks(errors.split(\"\\n\"), s => /^\\w+/.test(s)).filter(isExpectedError(cwd)).map(lines => lines.join(\"\\n\")).join(\"\\n\");\r","path":"src/harness/externalCompileRunner.ts","position":83,"original_position":83,"commit_id":"a5fa75a0cd095702d41e259cd2eb73d2c777b162","original_commit_id":"a5fa75a0cd095702d41e259cd2eb73d2c777b162","user":{"login":"andy-ms","id":19274678,"avatar_url":"https://avatars3.githubusercontent.com/u/19274678?v=4","gravatar_id":"","url":"https://api.github.com/users/andy-ms","html_url":"https://github.com/andy-ms","followers_url":"https://api.github.com/users/andy-ms/followers","following_url":"https://api.github.com/users/andy-ms/following{/other_user}","gists_url":"https://api.github.com/users/andy-ms/gists{/gist_id}","starred_url":"https://api.github.com/users/andy-ms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andy-ms/subscriptions","organizations_url":"https://api.github.com/users/andy-ms/orgs","repos_url":"https://api.github.com/users/andy-ms/repos","events_url":"https://api.github.com/users/andy-ms/events{/privacy}","received_events_url":"https://api.github.com/users/andy-ms/received_events","type":"User","site_admin":false},"body":"I'm suspicious of `/^\\w+/`, what if we make a diagnostic that starts with a number or quote?\r\n","created_at":"2017-11-10T14:57:07Z","updated_at":"2017-11-10T14:58:09Z","html_url":"https://github.com/Microsoft/TypeScript/pull/19887#discussion_r150254926","pull_request_url":"https://api.github.com/repos/Microsoft/TypeScript/pulls/19887","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/Microsoft/TypeScript/pulls/comments/150254926"},"html":{"href":"https://github.com/Microsoft/TypeScript/pull/19887#discussion_r150254926"},"pull_request":{"href":"https://api.github.com/repos/Microsoft/TypeScript/pulls/19887"}},"in_reply_to_id":150129578},"pull_request":{"url":"https://api.github.com/repos/Microsoft/TypeScript/pulls/19887","id":151779272,"html_url":"https://github.com/Microsoft/TypeScript/pull/19887","diff_url":"https://github.com/Microsoft/TypeScript/pull/19887.diff","patch_url":"https://github.com/Microsoft/TypeScript/pull/19887.patch","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/19887","number":19887,"state":"open","locked":false,"title":"DefinitelyTypedRunner skips ExpectErrors","user":{"login":"sandersn","id":293473,"avatar_url":"https://avatars1.githubusercontent.com/u/293473?v=4","gravatar_id":"","url":"https://api.github.com/users/sandersn","html_url":"https://github.com/sandersn","followers_url":"https://api.github.com/users/sandersn/followers","following_url":"https://api.github.com/users/sandersn/following{/other_user}","gists_url":"https://api.github.com/users/sandersn/gists{/gist_id}","starred_url":"https://api.github.com/users/sandersn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sandersn/subscriptions","organizations_url":"https://api.github.com/users/sandersn/orgs","repos_url":"https://api.github.com/users/sandersn/repos","events_url":"https://api.github.com/users/sandersn/events{/privacy}","received_events_url":"https://api.github.com/users/sandersn/received_events","type":"User","site_admin":false},"body":"If all errors were ExpectErrors, then it does not fail.","created_at":"2017-11-09T22:24:57Z","updated_at":"2017-11-10T14:58:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8d2406cef00ffd6412733f6ed43d4127b2c9b07f","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/Microsoft/TypeScript/pulls/19887/commits","review_comments_url":"https://api.github.com/repos/Microsoft/TypeScript/pulls/19887/comments","review_comment_url":"https://api.github.com/repos/Microsoft/TypeScript/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/19887/comments","statuses_url":"https://api.github.com/repos/Microsoft/TypeScript/statuses/a5fa75a0cd095702d41e259cd2eb73d2c777b162","head":{"label":"Microsoft:dt-runner-excludes-ExpectError","ref":"dt-runner-excludes-ExpectError","sha":"a5fa75a0cd095702d41e259cd2eb73d2c777b162","user":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars2.githubusercontent.com/u/6154722?v=4","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":20929025,"name":"TypeScript","full_name":"Microsoft/TypeScript","owner":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars2.githubusercontent.com/u/6154722?v=4","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Microsoft/TypeScript","description":"TypeScript is a superset of JavaScript that compiles to clean JavaScript output.","fork":false,"url":"https://api.github.com/repos/Microsoft/TypeScript","forks_url":"https://api.github.com/repos/Microsoft/TypeScript/forks","keys_url":"https://api.github.com/repos/Microsoft/TypeScript/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/TypeScript/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/TypeScript/teams","hooks_url":"https://api.github.com/repos/Microsoft/TypeScript/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/TypeScript/events","assignees_url":"https://api.github.com/repos/Microsoft/TypeScript/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/TypeScript/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/TypeScript/tags","blobs_url":"https://api.github.com/repos/Microsoft/TypeScript/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/TypeScript/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/TypeScript/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/TypeScript/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/TypeScript/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/TypeScript/languages","stargazers_url":"https://api.github.com/repos/Microsoft/TypeScript/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/TypeScript/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/TypeScript/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/TypeScript/subscription","commits_url":"https://api.github.com/repos/Microsoft/TypeScript/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/TypeScript/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/TypeScript/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/TypeScript/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/TypeScript/merges","archive_url":"https://api.github.com/repos/Microsoft/TypeScript/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/TypeScript/downloads","issues_url":"https://api.github.com/repos/Microsoft/TypeScript/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/TypeScript/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/TypeScript/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/TypeScript/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/TypeScript/releases{/id}","deployments_url":"https://api.github.com/repos/Microsoft/TypeScript/deployments","created_at":"2014-06-17T15:28:39Z","updated_at":"2017-11-10T14:31:13Z","pushed_at":"2017-11-10T14:18:02Z","git_url":"git://github.com/Microsoft/TypeScript.git","ssh_url":"git@github.com:Microsoft/TypeScript.git","clone_url":"https://github.com/Microsoft/TypeScript.git","svn_url":"https://github.com/Microsoft/TypeScript","homepage":"http://www.typescriptlang.org","size":475221,"stargazers_count":27804,"watchers_count":27804,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":4106,"mirror_url":null,"archived":false,"open_issues_count":2536,"forks":4106,"open_issues":2536,"watchers":27804,"default_branch":"master"}},"base":{"label":"Microsoft:master","ref":"master","sha":"b94940525b77f31a8e7782c92fe3ea53371c93fb","user":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars2.githubusercontent.com/u/6154722?v=4","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":20929025,"name":"TypeScript","full_name":"Microsoft/TypeScript","owner":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars2.githubusercontent.com/u/6154722?v=4","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Microsoft/TypeScript","description":"TypeScript is a superset of JavaScript that compiles to clean JavaScript output.","fork":false,"url":"https://api.github.com/repos/Microsoft/TypeScript","forks_url":"https://api.github.com/repos/Microsoft/TypeScript/forks","keys_url":"https://api.github.com/repos/Microsoft/TypeScript/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/TypeScript/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/TypeScript/teams","hooks_url":"https://api.github.com/repos/Microsoft/TypeScript/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/TypeScript/events","assignees_url":"https://api.github.com/repos/Microsoft/TypeScript/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/TypeScript/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/TypeScript/tags","blobs_url":"https://api.github.com/repos/Microsoft/TypeScript/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/TypeScript/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/TypeScript/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/TypeScript/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/TypeScript/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/TypeScript/languages","stargazers_url":"https://api.github.com/repos/Microsoft/TypeScript/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/TypeScript/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/TypeScript/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/TypeScript/subscription","commits_url":"https://api.github.com/repos/Microsoft/TypeScript/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/TypeScript/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/TypeScript/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/TypeScript/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/TypeScript/merges","archive_url":"https://api.github.com/repos/Microsoft/TypeScript/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/TypeScript/downloads","issues_url":"https://api.github.com/repos/Microsoft/TypeScript/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/TypeScript/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/TypeScript/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/TypeScript/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/TypeScript/releases{/id}","deployments_url":"https://api.github.com/repos/Microsoft/TypeScript/deployments","created_at":"2014-06-17T15:28:39Z","updated_at":"2017-11-10T14:31:13Z","pushed_at":"2017-11-10T14:18:02Z","git_url":"git://github.com/Microsoft/TypeScript.git","ssh_url":"git@github.com:Microsoft/TypeScript.git","clone_url":"https://github.com/Microsoft/TypeScript.git","svn_url":"https://github.com/Microsoft/TypeScript","homepage":"http://www.typescriptlang.org","size":475221,"stargazers_count":27804,"watchers_count":27804,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":4106,"mirror_url":null,"archived":false,"open_issues_count":2536,"forks":4106,"open_issues":2536,"watchers":27804,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Microsoft/TypeScript/pulls/19887"},"html":{"href":"https://github.com/Microsoft/TypeScript/pull/19887"},"issue":{"href":"https://api.github.com/repos/Microsoft/TypeScript/issues/19887"},"comments":{"href":"https://api.github.com/repos/Microsoft/TypeScript/issues/19887/comments"},"review_comments":{"href":"https://api.github.com/repos/Microsoft/TypeScript/pulls/19887/comments"},"review_comment":{"href":"https://api.github.com/repos/Microsoft/TypeScript/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Microsoft/TypeScript/pulls/19887/commits"},"statuses":{"href":"https://api.github.com/repos/Microsoft/TypeScript/statuses/a5fa75a0cd095702d41e259cd2eb73d2c777b162"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"andy-ms"}}