{"action":"created","comment":{"url":"https://api.github.com/repos/vfile/to-vfile/pulls/comments/166108724","pull_request_review_id":94138619,"id":166108724,"diff_hunk":"@@ -101,20 +115,47 @@ test('toVFile.read', function (t) {\n     });\n   });\n \n-  t.test('should pass an error on non-existing files', function (st) {\n-    st.plan(2);\n+  t.test('should work in promise mode (string with encoding)', function (st) {\n+    st.plan(3);\n+\n+    vfile.read('readme.md', 'utf8')\n+      .then(function (file) {\n+        st.equal(file.path, 'readme.md');\n+        st.equal(typeof file.contents, 'string');\n+        st.equal(file.toString(), fixture);\n+      })\n+      .catch(function () {\n+        st.fail('should resolve, not reject');","path":"test.js","position":37,"original_position":37,"commit_id":"ab94333a2ef05a7b42c9be8c47198f40a20fc997","original_commit_id":"ab94333a2ef05a7b42c9be8c47198f40a20fc997","user":{"login":"wooorm","id":944406,"avatar_url":"https://avatars0.githubusercontent.com/u/944406?v=4","gravatar_id":"","url":"https://api.github.com/users/wooorm","html_url":"https://github.com/wooorm","followers_url":"https://api.github.com/users/wooorm/followers","following_url":"https://api.github.com/users/wooorm/following{/other_user}","gists_url":"https://api.github.com/users/wooorm/gists{/gist_id}","starred_url":"https://api.github.com/users/wooorm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wooorm/subscriptions","organizations_url":"https://api.github.com/users/wooorm/orgs","repos_url":"https://api.github.com/users/wooorm/repos","events_url":"https://api.github.com/users/wooorm/events{/privacy}","received_events_url":"https://api.github.com/users/wooorm/received_events","type":"User","site_admin":false},"body":"Hey this is an `st`!","created_at":"2018-02-05T20:54:51Z","updated_at":"2018-02-05T20:57:10Z","html_url":"https://github.com/vfile/to-vfile/pull/5#discussion_r166108724","pull_request_url":"https://api.github.com/repos/vfile/to-vfile/pulls/5","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/vfile/to-vfile/pulls/comments/166108724"},"html":{"href":"https://github.com/vfile/to-vfile/pull/5#discussion_r166108724"},"pull_request":{"href":"https://api.github.com/repos/vfile/to-vfile/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/vfile/to-vfile/pulls/5","id":167186138,"html_url":"https://github.com/vfile/to-vfile/pull/5","diff_url":"https://github.com/vfile/to-vfile/pull/5.diff","patch_url":"https://github.com/vfile/to-vfile/pull/5.patch","issue_url":"https://api.github.com/repos/vfile/to-vfile/issues/5","number":5,"state":"open","locked":false,"title":"Return a Promise if callback is not defined in .read() and .write()","user":{"login":"kachkaev","id":608862,"avatar_url":"https://avatars3.githubusercontent.com/u/608862?v=4","gravatar_id":"","url":"https://api.github.com/users/kachkaev","html_url":"https://github.com/kachkaev","followers_url":"https://api.github.com/users/kachkaev/followers","following_url":"https://api.github.com/users/kachkaev/following{/other_user}","gists_url":"https://api.github.com/users/kachkaev/gists{/gist_id}","starred_url":"https://api.github.com/users/kachkaev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kachkaev/subscriptions","organizations_url":"https://api.github.com/users/kachkaev/orgs","repos_url":"https://api.github.com/users/kachkaev/repos","events_url":"https://api.github.com/users/kachkaev/events{/privacy}","received_events_url":"https://api.github.com/users/kachkaev/received_events","type":"User","site_admin":false},"body":"Closes #4 \r\n\r\nUsing the same approach for supporting both callbacks and promises as in [unified](https://github.com/unifiedjs/unified/blob/470ed8020e2f16c8af40ff63e81792268662faf4/index.js#L292-L311).","created_at":"2018-02-05T16:11:10Z","updated_at":"2018-02-05T20:57:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e44dd71a822099e14c45f3c2c455ef7e1e785c25","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"milestone":null,"commits_url":"https://api.github.com/repos/vfile/to-vfile/pulls/5/commits","review_comments_url":"https://api.github.com/repos/vfile/to-vfile/pulls/5/comments","review_comment_url":"https://api.github.com/repos/vfile/to-vfile/pulls/comments{/number}","comments_url":"https://api.github.com/repos/vfile/to-vfile/issues/5/comments","statuses_url":"https://api.github.com/repos/vfile/to-vfile/statuses/ab94333a2ef05a7b42c9be8c47198f40a20fc997","head":{"label":"vfile:return-promise","ref":"return-promise","sha":"ab94333a2ef05a7b42c9be8c47198f40a20fc997","user":{"login":"vfile","id":24635680,"avatar_url":"https://avatars0.githubusercontent.com/u/24635680?v=4","gravatar_id":"","url":"https://api.github.com/users/vfile","html_url":"https://github.com/vfile","followers_url":"https://api.github.com/users/vfile/followers","following_url":"https://api.github.com/users/vfile/following{/other_user}","gists_url":"https://api.github.com/users/vfile/gists{/gist_id}","starred_url":"https://api.github.com/users/vfile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vfile/subscriptions","organizations_url":"https://api.github.com/users/vfile/orgs","repos_url":"https://api.github.com/users/vfile/repos","events_url":"https://api.github.com/users/vfile/events{/privacy}","received_events_url":"https://api.github.com/users/vfile/received_events","type":"Organization","site_admin":false},"repo":{"id":40616717,"name":"to-vfile","full_name":"vfile/to-vfile","owner":{"login":"vfile","id":24635680,"avatar_url":"https://avatars0.githubusercontent.com/u/24635680?v=4","gravatar_id":"","url":"https://api.github.com/users/vfile","html_url":"https://github.com/vfile","followers_url":"https://api.github.com/users/vfile/followers","following_url":"https://api.github.com/users/vfile/following{/other_user}","gists_url":"https://api.github.com/users/vfile/gists{/gist_id}","starred_url":"https://api.github.com/users/vfile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vfile/subscriptions","organizations_url":"https://api.github.com/users/vfile/orgs","repos_url":"https://api.github.com/users/vfile/repos","events_url":"https://api.github.com/users/vfile/events{/privacy}","received_events_url":"https://api.github.com/users/vfile/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/vfile/to-vfile","description":"Create a vfile from a file-path","fork":false,"url":"https://api.github.com/repos/vfile/to-vfile","forks_url":"https://api.github.com/repos/vfile/to-vfile/forks","keys_url":"https://api.github.com/repos/vfile/to-vfile/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vfile/to-vfile/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vfile/to-vfile/teams","hooks_url":"https://api.github.com/repos/vfile/to-vfile/hooks","issue_events_url":"https://api.github.com/repos/vfile/to-vfile/issues/events{/number}","events_url":"https://api.github.com/repos/vfile/to-vfile/events","assignees_url":"https://api.github.com/repos/vfile/to-vfile/assignees{/user}","branches_url":"https://api.github.com/repos/vfile/to-vfile/branches{/branch}","tags_url":"https://api.github.com/repos/vfile/to-vfile/tags","blobs_url":"https://api.github.com/repos/vfile/to-vfile/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vfile/to-vfile/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vfile/to-vfile/git/refs{/sha}","trees_url":"https://api.github.com/repos/vfile/to-vfile/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vfile/to-vfile/statuses/{sha}","languages_url":"https://api.github.com/repos/vfile/to-vfile/languages","stargazers_url":"https://api.github.com/repos/vfile/to-vfile/stargazers","contributors_url":"https://api.github.com/repos/vfile/to-vfile/contributors","subscribers_url":"https://api.github.com/repos/vfile/to-vfile/subscribers","subscription_url":"https://api.github.com/repos/vfile/to-vfile/subscription","commits_url":"https://api.github.com/repos/vfile/to-vfile/commits{/sha}","git_commits_url":"https://api.github.com/repos/vfile/to-vfile/git/commits{/sha}","comments_url":"https://api.github.com/repos/vfile/to-vfile/comments{/number}","issue_comment_url":"https://api.github.com/repos/vfile/to-vfile/issues/comments{/number}","contents_url":"https://api.github.com/repos/vfile/to-vfile/contents/{+path}","compare_url":"https://api.github.com/repos/vfile/to-vfile/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vfile/to-vfile/merges","archive_url":"https://api.github.com/repos/vfile/to-vfile/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vfile/to-vfile/downloads","issues_url":"https://api.github.com/repos/vfile/to-vfile/issues{/number}","pulls_url":"https://api.github.com/repos/vfile/to-vfile/pulls{/number}","milestones_url":"https://api.github.com/repos/vfile/to-vfile/milestones{/number}","notifications_url":"https://api.github.com/repos/vfile/to-vfile/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vfile/to-vfile/labels{/name}","releases_url":"https://api.github.com/repos/vfile/to-vfile/releases{/id}","deployments_url":"https://api.github.com/repos/vfile/to-vfile/deployments","created_at":"2015-08-12T18:13:50Z","updated_at":"2018-02-02T15:43:14Z","pushed_at":"2018-02-05T20:51:31Z","git_url":"git://github.com/vfile/to-vfile.git","ssh_url":"git@github.com:vfile/to-vfile.git","clone_url":"https://github.com/vfile/to-vfile.git","svn_url":"https://github.com/vfile/to-vfile","homepage":"https://unifiedjs.github.io","size":33,"stargazers_count":14,"watchers_count":14,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":2,"open_issues":2,"watchers":14,"default_branch":"master"}},"base":{"label":"vfile:master","ref":"master","sha":"34deee06e8c3113a3f8ab518c674eee26ec62f43","user":{"login":"vfile","id":24635680,"avatar_url":"https://avatars0.githubusercontent.com/u/24635680?v=4","gravatar_id":"","url":"https://api.github.com/users/vfile","html_url":"https://github.com/vfile","followers_url":"https://api.github.com/users/vfile/followers","following_url":"https://api.github.com/users/vfile/following{/other_user}","gists_url":"https://api.github.com/users/vfile/gists{/gist_id}","starred_url":"https://api.github.com/users/vfile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vfile/subscriptions","organizations_url":"https://api.github.com/users/vfile/orgs","repos_url":"https://api.github.com/users/vfile/repos","events_url":"https://api.github.com/users/vfile/events{/privacy}","received_events_url":"https://api.github.com/users/vfile/received_events","type":"Organization","site_admin":false},"repo":{"id":40616717,"name":"to-vfile","full_name":"vfile/to-vfile","owner":{"login":"vfile","id":24635680,"avatar_url":"https://avatars0.githubusercontent.com/u/24635680?v=4","gravatar_id":"","url":"https://api.github.com/users/vfile","html_url":"https://github.com/vfile","followers_url":"https://api.github.com/users/vfile/followers","following_url":"https://api.github.com/users/vfile/following{/other_user}","gists_url":"https://api.github.com/users/vfile/gists{/gist_id}","starred_url":"https://api.github.com/users/vfile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vfile/subscriptions","organizations_url":"https://api.github.com/users/vfile/orgs","repos_url":"https://api.github.com/users/vfile/repos","events_url":"https://api.github.com/users/vfile/events{/privacy}","received_events_url":"https://api.github.com/users/vfile/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/vfile/to-vfile","description":"Create a vfile from a file-path","fork":false,"url":"https://api.github.com/repos/vfile/to-vfile","forks_url":"https://api.github.com/repos/vfile/to-vfile/forks","keys_url":"https://api.github.com/repos/vfile/to-vfile/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vfile/to-vfile/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vfile/to-vfile/teams","hooks_url":"https://api.github.com/repos/vfile/to-vfile/hooks","issue_events_url":"https://api.github.com/repos/vfile/to-vfile/issues/events{/number}","events_url":"https://api.github.com/repos/vfile/to-vfile/events","assignees_url":"https://api.github.com/repos/vfile/to-vfile/assignees{/user}","branches_url":"https://api.github.com/repos/vfile/to-vfile/branches{/branch}","tags_url":"https://api.github.com/repos/vfile/to-vfile/tags","blobs_url":"https://api.github.com/repos/vfile/to-vfile/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vfile/to-vfile/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vfile/to-vfile/git/refs{/sha}","trees_url":"https://api.github.com/repos/vfile/to-vfile/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vfile/to-vfile/statuses/{sha}","languages_url":"https://api.github.com/repos/vfile/to-vfile/languages","stargazers_url":"https://api.github.com/repos/vfile/to-vfile/stargazers","contributors_url":"https://api.github.com/repos/vfile/to-vfile/contributors","subscribers_url":"https://api.github.com/repos/vfile/to-vfile/subscribers","subscription_url":"https://api.github.com/repos/vfile/to-vfile/subscription","commits_url":"https://api.github.com/repos/vfile/to-vfile/commits{/sha}","git_commits_url":"https://api.github.com/repos/vfile/to-vfile/git/commits{/sha}","comments_url":"https://api.github.com/repos/vfile/to-vfile/comments{/number}","issue_comment_url":"https://api.github.com/repos/vfile/to-vfile/issues/comments{/number}","contents_url":"https://api.github.com/repos/vfile/to-vfile/contents/{+path}","compare_url":"https://api.github.com/repos/vfile/to-vfile/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vfile/to-vfile/merges","archive_url":"https://api.github.com/repos/vfile/to-vfile/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vfile/to-vfile/downloads","issues_url":"https://api.github.com/repos/vfile/to-vfile/issues{/number}","pulls_url":"https://api.github.com/repos/vfile/to-vfile/pulls{/number}","milestones_url":"https://api.github.com/repos/vfile/to-vfile/milestones{/number}","notifications_url":"https://api.github.com/repos/vfile/to-vfile/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vfile/to-vfile/labels{/name}","releases_url":"https://api.github.com/repos/vfile/to-vfile/releases{/id}","deployments_url":"https://api.github.com/repos/vfile/to-vfile/deployments","created_at":"2015-08-12T18:13:50Z","updated_at":"2018-02-02T15:43:14Z","pushed_at":"2018-02-05T20:51:31Z","git_url":"git://github.com/vfile/to-vfile.git","ssh_url":"git@github.com:vfile/to-vfile.git","clone_url":"https://github.com/vfile/to-vfile.git","svn_url":"https://github.com/vfile/to-vfile","homepage":"https://unifiedjs.github.io","size":33,"stargazers_count":14,"watchers_count":14,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":2,"open_issues":2,"watchers":14,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/vfile/to-vfile/pulls/5"},"html":{"href":"https://github.com/vfile/to-vfile/pull/5"},"issue":{"href":"https://api.github.com/repos/vfile/to-vfile/issues/5"},"comments":{"href":"https://api.github.com/repos/vfile/to-vfile/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/vfile/to-vfile/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/vfile/to-vfile/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/vfile/to-vfile/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/vfile/to-vfile/statuses/ab94333a2ef05a7b42c9be8c47198f40a20fc997"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"wooorm"}}