{"action":"created","comment":{"url":"https://api.github.com/repos/static-dev/posthtml-content/pulls/comments/68510222","id":68510222,"diff_hunk":"@@ -1,32 +1,98 @@\n-const fs = require('fs')\n-const path = require('path')\n+// ------------------------------------\n+// #POSTHTML - CONTENT - TEST\n+// ------------------------------------\n+\n const test = require('ava')\n+\n+const { join } = require('path')\n+const { readFileSync } = require('fs')\n+\n const posthtml = require('posthtml')\n-const markdown = require('markdown-it')\n-const content = require('..')\n-const fixtures = path.join(__dirname, 'fixtures')\n+const plugin = require('..')\n+\n+const fixtures = (file) => readFileSync(join(__dirname, 'fixtures', file))\n+\n+test('1 - Text', (t) => {\n+  const html = fixtures('txt.html')\n+  const plugins = [ plugin({ txt: () => 'Lorem' }) ]\n+\n+  posthtml(plugins)\n+    .process(html)\n+    .then((result) => result.html)\n+    .then((html) => {\n+      t.regex(/<p>Lorem<\\/p>/, html)\n+    })\n+})\n \n-test('basic', (t) => {\n-  const html = fs.readFileSync(path.join(fixtures, 'basic.html'))\n-  const plugins = [content({ custom: () => 'foo' })]\n+test('2 - Strings ES2015', (t) => {\n+  const html = fixtures('es6.html')\n+  const text = 'exercitation'\n+  const plugins = [ plugin({\n+    es6: () => `Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do\n+    eiusmodtempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim\n+    veniam, quis nostrud ${text.toUpperCase()} ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate\n+    velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat\n+    cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id\n+    est laborum.`","path":"test/index.js","position":44,"original_position":44,"commit_id":"02d5af48a80ac1ba21b70e11ea9fed2d9b5a9d57","original_commit_id":"02d5af48a80ac1ba21b70e11ea9fed2d9b5a9d57","user":{"login":"michael-ciniawsky","id":5419992,"avatar_url":"https://avatars.githubusercontent.com/u/5419992?v=3","gravatar_id":"","url":"https://api.github.com/users/michael-ciniawsky","html_url":"https://github.com/michael-ciniawsky","followers_url":"https://api.github.com/users/michael-ciniawsky/followers","following_url":"https://api.github.com/users/michael-ciniawsky/following{/other_user}","gists_url":"https://api.github.com/users/michael-ciniawsky/gists{/gist_id}","starred_url":"https://api.github.com/users/michael-ciniawsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michael-ciniawsky/subscriptions","organizations_url":"https://api.github.com/users/michael-ciniawsky/orgs","repos_url":"https://api.github.com/users/michael-ciniawsky/repos","events_url":"https://api.github.com/users/michael-ciniawsky/events{/privacy}","received_events_url":"https://api.github.com/users/michael-ciniawsky/received_events","type":"User","site_admin":false},"body":"kk i make it shorter ","created_at":"2016-06-26T21:35:31Z","updated_at":"2016-06-26T21:35:31Z","html_url":"https://github.com/static-dev/posthtml-content/pull/1#discussion_r68510222","pull_request_url":"https://api.github.com/repos/static-dev/posthtml-content/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/static-dev/posthtml-content/pulls/comments/68510222"},"html":{"href":"https://github.com/static-dev/posthtml-content/pull/1#discussion_r68510222"},"pull_request":{"href":"https://api.github.com/repos/static-dev/posthtml-content/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/static-dev/posthtml-content/pulls/1","id":75218337,"html_url":"https://github.com/static-dev/posthtml-content/pull/1","diff_url":"https://github.com/static-dev/posthtml-content/pull/1.diff","patch_url":"https://github.com/static-dev/posthtml-content/pull/1.patch","issue_url":"https://api.github.com/repos/static-dev/posthtml-content/issues/1","number":1,"state":"open","locked":false,"title":"Use node.tag as selector option, README updates","user":{"login":"michael-ciniawsky","id":5419992,"avatar_url":"https://avatars.githubusercontent.com/u/5419992?v=3","gravatar_id":"","url":"https://api.github.com/users/michael-ciniawsky","html_url":"https://github.com/michael-ciniawsky","followers_url":"https://api.github.com/users/michael-ciniawsky/followers","following_url":"https://api.github.com/users/michael-ciniawsky/following{/other_user}","gists_url":"https://api.github.com/users/michael-ciniawsky/gists{/gist_id}","starred_url":"https://api.github.com/users/michael-ciniawsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michael-ciniawsky/subscriptions","organizations_url":"https://api.github.com/users/michael-ciniawsky/orgs","repos_url":"https://api.github.com/users/michael-ciniawsky/repos","events_url":"https://api.github.com/users/michael-ciniawsky/events{/privacy}","received_events_url":"https://api.github.com/users/michael-ciniawsky/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-06-26T00:50:38Z","updated_at":"2016-06-26T21:35:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"181200ab25d6574a2cc6b579273a8919f13721f5","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/static-dev/posthtml-content/pulls/1/commits","review_comments_url":"https://api.github.com/repos/static-dev/posthtml-content/pulls/1/comments","review_comment_url":"https://api.github.com/repos/static-dev/posthtml-content/pulls/comments{/number}","comments_url":"https://api.github.com/repos/static-dev/posthtml-content/issues/1/comments","statuses_url":"https://api.github.com/repos/static-dev/posthtml-content/statuses/02d5af48a80ac1ba21b70e11ea9fed2d9b5a9d57","head":{"label":"posthtml:master","ref":"master","sha":"02d5af48a80ac1ba21b70e11ea9fed2d9b5a9d57","user":{"login":"posthtml","id":13065692,"avatar_url":"https://avatars.githubusercontent.com/u/13065692?v=3","gravatar_id":"","url":"https://api.github.com/users/posthtml","html_url":"https://github.com/posthtml","followers_url":"https://api.github.com/users/posthtml/followers","following_url":"https://api.github.com/users/posthtml/following{/other_user}","gists_url":"https://api.github.com/users/posthtml/gists{/gist_id}","starred_url":"https://api.github.com/users/posthtml/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/posthtml/subscriptions","organizations_url":"https://api.github.com/users/posthtml/orgs","repos_url":"https://api.github.com/users/posthtml/repos","events_url":"https://api.github.com/users/posthtml/events{/privacy}","received_events_url":"https://api.github.com/users/posthtml/received_events","type":"Organization","site_admin":false},"repo":{"id":61967627,"name":"posthtml-content","full_name":"posthtml/posthtml-content","owner":{"login":"posthtml","id":13065692,"avatar_url":"https://avatars.githubusercontent.com/u/13065692?v=3","gravatar_id":"","url":"https://api.github.com/users/posthtml","html_url":"https://github.com/posthtml","followers_url":"https://api.github.com/users/posthtml/followers","following_url":"https://api.github.com/users/posthtml/following{/other_user}","gists_url":"https://api.github.com/users/posthtml/gists{/gist_id}","starred_url":"https://api.github.com/users/posthtml/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/posthtml/subscriptions","organizations_url":"https://api.github.com/users/posthtml/orgs","repos_url":"https://api.github.com/users/posthtml/repos","events_url":"https://api.github.com/users/posthtml/events{/privacy}","received_events_url":"https://api.github.com/users/posthtml/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/posthtml/posthtml-content","description":"Transform any content with a custom function","fork":true,"url":"https://api.github.com/repos/posthtml/posthtml-content","forks_url":"https://api.github.com/repos/posthtml/posthtml-content/forks","keys_url":"https://api.github.com/repos/posthtml/posthtml-content/keys{/key_id}","collaborators_url":"https://api.github.com/repos/posthtml/posthtml-content/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/posthtml/posthtml-content/teams","hooks_url":"https://api.github.com/repos/posthtml/posthtml-content/hooks","issue_events_url":"https://api.github.com/repos/posthtml/posthtml-content/issues/events{/number}","events_url":"https://api.github.com/repos/posthtml/posthtml-content/events","assignees_url":"https://api.github.com/repos/posthtml/posthtml-content/assignees{/user}","branches_url":"https://api.github.com/repos/posthtml/posthtml-content/branches{/branch}","tags_url":"https://api.github.com/repos/posthtml/posthtml-content/tags","blobs_url":"https://api.github.com/repos/posthtml/posthtml-content/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/posthtml/posthtml-content/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/posthtml/posthtml-content/git/refs{/sha}","trees_url":"https://api.github.com/repos/posthtml/posthtml-content/git/trees{/sha}","statuses_url":"https://api.github.com/repos/posthtml/posthtml-content/statuses/{sha}","languages_url":"https://api.github.com/repos/posthtml/posthtml-content/languages","stargazers_url":"https://api.github.com/repos/posthtml/posthtml-content/stargazers","contributors_url":"https://api.github.com/repos/posthtml/posthtml-content/contributors","subscribers_url":"https://api.github.com/repos/posthtml/posthtml-content/subscribers","subscription_url":"https://api.github.com/repos/posthtml/posthtml-content/subscription","commits_url":"https://api.github.com/repos/posthtml/posthtml-content/commits{/sha}","git_commits_url":"https://api.github.com/repos/posthtml/posthtml-content/git/commits{/sha}","comments_url":"https://api.github.com/repos/posthtml/posthtml-content/comments{/number}","issue_comment_url":"https://api.github.com/repos/posthtml/posthtml-content/issues/comments{/number}","contents_url":"https://api.github.com/repos/posthtml/posthtml-content/contents/{+path}","compare_url":"https://api.github.com/repos/posthtml/posthtml-content/compare/{base}...{head}","merges_url":"https://api.github.com/repos/posthtml/posthtml-content/merges","archive_url":"https://api.github.com/repos/posthtml/posthtml-content/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/posthtml/posthtml-content/downloads","issues_url":"https://api.github.com/repos/posthtml/posthtml-content/issues{/number}","pulls_url":"https://api.github.com/repos/posthtml/posthtml-content/pulls{/number}","milestones_url":"https://api.github.com/repos/posthtml/posthtml-content/milestones{/number}","notifications_url":"https://api.github.com/repos/posthtml/posthtml-content/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/posthtml/posthtml-content/labels{/name}","releases_url":"https://api.github.com/repos/posthtml/posthtml-content/releases{/id}","deployments_url":"https://api.github.com/repos/posthtml/posthtml-content/deployments","created_at":"2016-06-26T00:43:55Z","updated_at":"2016-06-26T00:43:56Z","pushed_at":"2016-06-26T03:48:16Z","git_url":"git://github.com/posthtml/posthtml-content.git","ssh_url":"git@github.com:posthtml/posthtml-content.git","clone_url":"https://github.com/posthtml/posthtml-content.git","svn_url":"https://github.com/posthtml/posthtml-content","homepage":null,"size":15,"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":"static-dev:master","ref":"master","sha":"5627a52705efd8400e7faa2808c5d16c6f9386cc","user":{"login":"static-dev","id":19313279,"avatar_url":"https://avatars.githubusercontent.com/u/19313279?v=3","gravatar_id":"","url":"https://api.github.com/users/static-dev","html_url":"https://github.com/static-dev","followers_url":"https://api.github.com/users/static-dev/followers","following_url":"https://api.github.com/users/static-dev/following{/other_user}","gists_url":"https://api.github.com/users/static-dev/gists{/gist_id}","starred_url":"https://api.github.com/users/static-dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/static-dev/subscriptions","organizations_url":"https://api.github.com/users/static-dev/orgs","repos_url":"https://api.github.com/users/static-dev/repos","events_url":"https://api.github.com/users/static-dev/events{/privacy}","received_events_url":"https://api.github.com/users/static-dev/received_events","type":"Organization","site_admin":false},"repo":{"id":61911998,"name":"posthtml-content","full_name":"static-dev/posthtml-content","owner":{"login":"static-dev","id":19313279,"avatar_url":"https://avatars.githubusercontent.com/u/19313279?v=3","gravatar_id":"","url":"https://api.github.com/users/static-dev","html_url":"https://github.com/static-dev","followers_url":"https://api.github.com/users/static-dev/followers","following_url":"https://api.github.com/users/static-dev/following{/other_user}","gists_url":"https://api.github.com/users/static-dev/gists{/gist_id}","starred_url":"https://api.github.com/users/static-dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/static-dev/subscriptions","organizations_url":"https://api.github.com/users/static-dev/orgs","repos_url":"https://api.github.com/users/static-dev/repos","events_url":"https://api.github.com/users/static-dev/events{/privacy}","received_events_url":"https://api.github.com/users/static-dev/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/static-dev/posthtml-content","description":"Transform any content with a custom function","fork":false,"url":"https://api.github.com/repos/static-dev/posthtml-content","forks_url":"https://api.github.com/repos/static-dev/posthtml-content/forks","keys_url":"https://api.github.com/repos/static-dev/posthtml-content/keys{/key_id}","collaborators_url":"https://api.github.com/repos/static-dev/posthtml-content/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/static-dev/posthtml-content/teams","hooks_url":"https://api.github.com/repos/static-dev/posthtml-content/hooks","issue_events_url":"https://api.github.com/repos/static-dev/posthtml-content/issues/events{/number}","events_url":"https://api.github.com/repos/static-dev/posthtml-content/events","assignees_url":"https://api.github.com/repos/static-dev/posthtml-content/assignees{/user}","branches_url":"https://api.github.com/repos/static-dev/posthtml-content/branches{/branch}","tags_url":"https://api.github.com/repos/static-dev/posthtml-content/tags","blobs_url":"https://api.github.com/repos/static-dev/posthtml-content/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/static-dev/posthtml-content/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/static-dev/posthtml-content/git/refs{/sha}","trees_url":"https://api.github.com/repos/static-dev/posthtml-content/git/trees{/sha}","statuses_url":"https://api.github.com/repos/static-dev/posthtml-content/statuses/{sha}","languages_url":"https://api.github.com/repos/static-dev/posthtml-content/languages","stargazers_url":"https://api.github.com/repos/static-dev/posthtml-content/stargazers","contributors_url":"https://api.github.com/repos/static-dev/posthtml-content/contributors","subscribers_url":"https://api.github.com/repos/static-dev/posthtml-content/subscribers","subscription_url":"https://api.github.com/repos/static-dev/posthtml-content/subscription","commits_url":"https://api.github.com/repos/static-dev/posthtml-content/commits{/sha}","git_commits_url":"https://api.github.com/repos/static-dev/posthtml-content/git/commits{/sha}","comments_url":"https://api.github.com/repos/static-dev/posthtml-content/comments{/number}","issue_comment_url":"https://api.github.com/repos/static-dev/posthtml-content/issues/comments{/number}","contents_url":"https://api.github.com/repos/static-dev/posthtml-content/contents/{+path}","compare_url":"https://api.github.com/repos/static-dev/posthtml-content/compare/{base}...{head}","merges_url":"https://api.github.com/repos/static-dev/posthtml-content/merges","archive_url":"https://api.github.com/repos/static-dev/posthtml-content/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/static-dev/posthtml-content/downloads","issues_url":"https://api.github.com/repos/static-dev/posthtml-content/issues{/number}","pulls_url":"https://api.github.com/repos/static-dev/posthtml-content/pulls{/number}","milestones_url":"https://api.github.com/repos/static-dev/posthtml-content/milestones{/number}","notifications_url":"https://api.github.com/repos/static-dev/posthtml-content/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/static-dev/posthtml-content/labels{/name}","releases_url":"https://api.github.com/repos/static-dev/posthtml-content/releases{/id}","deployments_url":"https://api.github.com/repos/static-dev/posthtml-content/deployments","created_at":"2016-06-24T20:56:16Z","updated_at":"2016-06-24T23:37:37Z","pushed_at":"2016-06-26T03:48:16Z","git_url":"git://github.com/static-dev/posthtml-content.git","ssh_url":"git@github.com:static-dev/posthtml-content.git","clone_url":"https://github.com/static-dev/posthtml-content.git","svn_url":"https://github.com/static-dev/posthtml-content","homepage":null,"size":6,"stargazers_count":3,"watchers_count":3,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/static-dev/posthtml-content/pulls/1"},"html":{"href":"https://github.com/static-dev/posthtml-content/pull/1"},"issue":{"href":"https://api.github.com/repos/static-dev/posthtml-content/issues/1"},"comments":{"href":"https://api.github.com/repos/static-dev/posthtml-content/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/static-dev/posthtml-content/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/static-dev/posthtml-content/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/static-dev/posthtml-content/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/static-dev/posthtml-content/statuses/02d5af48a80ac1ba21b70e11ea9fed2d9b5a9d57"}}}}
{"actor":{"display_login":"michael-ciniawsky"}}