{"action":"created","comment":{"url":"https://api.github.com/repos/vanng822/webpack-touch/pulls/comments/179944906","pull_request_review_id":110284473,"id":179944906,"diff_hunk":"@@ -0,0 +1,81 @@\n+const fs = require('fs');\n+const path = require('path');\n+const assert = require('assert');\n+const webpack = require('webpack');\n+const WebpackTouch = require('..');\n+\n+const touchedFile = path.resolve(__dirname, './dist/touched.file');\n+const config = require('./webpack.config');\n+const defaultConfig = Object.assign({}, config, {\n+  plugins: [\n+    new WebpackTouch({\n+      filename: touchedFile,\n+    }),\n+  ],\n+});\n+\n+\n+const runWebpack = (options) => {\n+  return new Promise((resolve, reject) => {\n+    webpack(options, (err, stats) => {\n+      if (err) {\n+        reject(err);\n+        return;\n+      }\n+      resolve(stats);\n+    });\n+  });\n+};\n+\n+const removeTouchedFile = () => {\n+  if (fs.existsSync(touchedFile)) {\n+    fs.unlinkSync(touchedFile);\n+  }\n+};\n+\n+describe('WebpackTouchPlugin', () => {\n+  before(removeTouchedFile);\n+  after(removeTouchedFile);\n+\n+  it(`${touchedFile} not created yet (just to be sure)`, () => {\n+    assert.ok(!fs.existsSync(touchedFile), `${touchedFile} does not exist`);\n+  });\n+\n+  it(`creates ${touchedFile}`, () => {\n+    return runWebpack(defaultConfig)\n+      .then(() => {\n+        assert.ok(fs.existsSync(touchedFile), `${touchedFile} exists`);\n+      });\n+  });\n+\n+  it(`updates ${touchedFile} ctime`, () => {\n+    const ctime = fs.statSync(touchedFile).ctime;\n+    return runWebpack(defaultConfig)\n+      .then(() => {\n+        assert.notEqual(ctime, fs.statSync(touchedFile).ctime);\n+      });\n+  });\n+\n+  it(`triggers fn.watch listening on ${touchedFile}`, () => {\n+    return Promise.all([\n+      runWebpack(defaultConfig),\n+      new Promise((resolve) => {\n+        const watcher = fs.watch(touchedFile);\n+        watcher.on('change', () => {\n+          watcher.close();\n+          resolve();\n+        });\n+      })\n+    ]);\n+  });\n+\n+  it(`gets broken without filename`, () => {\n+    const WebpackTouch = require('..');\n+    try {\n+      new WebpackTouch({});","path":"test/test.js","position":8,"original_position":75,"commit_id":"b987ea9aa25170bca736b75e5fd160aba6c47322","original_commit_id":"b61d9942b7654a9d23d77975ebcc1d3e48432cf6","user":{"login":"ixth","id":107447,"avatar_url":"https://avatars1.githubusercontent.com/u/107447?v=4","gravatar_id":"","url":"https://api.github.com/users/ixth","html_url":"https://github.com/ixth","followers_url":"https://api.github.com/users/ixth/followers","following_url":"https://api.github.com/users/ixth/following{/other_user}","gists_url":"https://api.github.com/users/ixth/gists{/gist_id}","starred_url":"https://api.github.com/users/ixth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ixth/subscriptions","organizations_url":"https://api.github.com/users/ixth/orgs","repos_url":"https://api.github.com/users/ixth/repos","events_url":"https://api.github.com/users/ixth/events{/privacy}","received_events_url":"https://api.github.com/users/ixth/received_events","type":"User","site_admin":false},"body":"Maybe because of some language difficulties I don't really understand what you mean. I see that we can't be sure if it fails because of broken config or not. What do you want me to do to be sure?","created_at":"2018-04-08T11:45:35Z","updated_at":"2018-04-08T11:45:36Z","html_url":"https://github.com/vanng822/webpack-touch/pull/3#discussion_r179944906","pull_request_url":"https://api.github.com/repos/vanng822/webpack-touch/pulls/3","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/vanng822/webpack-touch/pulls/comments/179944906"},"html":{"href":"https://github.com/vanng822/webpack-touch/pull/3#discussion_r179944906"},"pull_request":{"href":"https://api.github.com/repos/vanng822/webpack-touch/pulls/3"}},"in_reply_to_id":179914284},"pull_request":{"url":"https://api.github.com/repos/vanng822/webpack-touch/pulls/3","id":179562720,"html_url":"https://github.com/vanng822/webpack-touch/pull/3","diff_url":"https://github.com/vanng822/webpack-touch/pull/3.diff","patch_url":"https://github.com/vanng822/webpack-touch/pull/3.patch","issue_url":"https://api.github.com/repos/vanng822/webpack-touch/issues/3","number":3,"state":"open","locked":false,"title":"Open and close file instead of writing","user":{"login":"ixth","id":107447,"avatar_url":"https://avatars1.githubusercontent.com/u/107447?v=4","gravatar_id":"","url":"https://api.github.com/users/ixth","html_url":"https://github.com/ixth","followers_url":"https://api.github.com/users/ixth/followers","following_url":"https://api.github.com/users/ixth/following{/other_user}","gists_url":"https://api.github.com/users/ixth/gists{/gist_id}","starred_url":"https://api.github.com/users/ixth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ixth/subscriptions","organizations_url":"https://api.github.com/users/ixth/orgs","repos_url":"https://api.github.com/users/ixth/repos","events_url":"https://api.github.com/users/ixth/events{/privacy}","received_events_url":"https://api.github.com/users/ixth/received_events","type":"User","site_admin":false},"body":"Changed behaviour from writing to file to opening and closing it, which seems to work fine.\r\nBased on #2.","created_at":"2018-04-05T03:12:27Z","updated_at":"2018-04-08T11:45:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cbab575b0ccb3a80cf0fa65916f62ff4814e31ee","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/vanng822/webpack-touch/pulls/3/commits","review_comments_url":"https://api.github.com/repos/vanng822/webpack-touch/pulls/3/comments","review_comment_url":"https://api.github.com/repos/vanng822/webpack-touch/pulls/comments{/number}","comments_url":"https://api.github.com/repos/vanng822/webpack-touch/issues/3/comments","statuses_url":"https://api.github.com/repos/vanng822/webpack-touch/statuses/b987ea9aa25170bca736b75e5fd160aba6c47322","head":{"label":"ixth:touch","ref":"touch","sha":"b987ea9aa25170bca736b75e5fd160aba6c47322","user":{"login":"ixth","id":107447,"avatar_url":"https://avatars1.githubusercontent.com/u/107447?v=4","gravatar_id":"","url":"https://api.github.com/users/ixth","html_url":"https://github.com/ixth","followers_url":"https://api.github.com/users/ixth/followers","following_url":"https://api.github.com/users/ixth/following{/other_user}","gists_url":"https://api.github.com/users/ixth/gists{/gist_id}","starred_url":"https://api.github.com/users/ixth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ixth/subscriptions","organizations_url":"https://api.github.com/users/ixth/orgs","repos_url":"https://api.github.com/users/ixth/repos","events_url":"https://api.github.com/users/ixth/events{/privacy}","received_events_url":"https://api.github.com/users/ixth/received_events","type":"User","site_admin":false},"repo":{"id":128094295,"name":"webpack-touch","full_name":"ixth/webpack-touch","owner":{"login":"ixth","id":107447,"avatar_url":"https://avatars1.githubusercontent.com/u/107447?v=4","gravatar_id":"","url":"https://api.github.com/users/ixth","html_url":"https://github.com/ixth","followers_url":"https://api.github.com/users/ixth/followers","following_url":"https://api.github.com/users/ixth/following{/other_user}","gists_url":"https://api.github.com/users/ixth/gists{/gist_id}","starred_url":"https://api.github.com/users/ixth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ixth/subscriptions","organizations_url":"https://api.github.com/users/ixth/orgs","repos_url":"https://api.github.com/users/ixth/repos","events_url":"https://api.github.com/users/ixth/events{/privacy}","received_events_url":"https://api.github.com/users/ixth/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ixth/webpack-touch","description":"Webpack plugin for touching a file when done to tell other process to take action.","fork":true,"url":"https://api.github.com/repos/ixth/webpack-touch","forks_url":"https://api.github.com/repos/ixth/webpack-touch/forks","keys_url":"https://api.github.com/repos/ixth/webpack-touch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ixth/webpack-touch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ixth/webpack-touch/teams","hooks_url":"https://api.github.com/repos/ixth/webpack-touch/hooks","issue_events_url":"https://api.github.com/repos/ixth/webpack-touch/issues/events{/number}","events_url":"https://api.github.com/repos/ixth/webpack-touch/events","assignees_url":"https://api.github.com/repos/ixth/webpack-touch/assignees{/user}","branches_url":"https://api.github.com/repos/ixth/webpack-touch/branches{/branch}","tags_url":"https://api.github.com/repos/ixth/webpack-touch/tags","blobs_url":"https://api.github.com/repos/ixth/webpack-touch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ixth/webpack-touch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ixth/webpack-touch/git/refs{/sha}","trees_url":"https://api.github.com/repos/ixth/webpack-touch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ixth/webpack-touch/statuses/{sha}","languages_url":"https://api.github.com/repos/ixth/webpack-touch/languages","stargazers_url":"https://api.github.com/repos/ixth/webpack-touch/stargazers","contributors_url":"https://api.github.com/repos/ixth/webpack-touch/contributors","subscribers_url":"https://api.github.com/repos/ixth/webpack-touch/subscribers","subscription_url":"https://api.github.com/repos/ixth/webpack-touch/subscription","commits_url":"https://api.github.com/repos/ixth/webpack-touch/commits{/sha}","git_commits_url":"https://api.github.com/repos/ixth/webpack-touch/git/commits{/sha}","comments_url":"https://api.github.com/repos/ixth/webpack-touch/comments{/number}","issue_comment_url":"https://api.github.com/repos/ixth/webpack-touch/issues/comments{/number}","contents_url":"https://api.github.com/repos/ixth/webpack-touch/contents/{+path}","compare_url":"https://api.github.com/repos/ixth/webpack-touch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ixth/webpack-touch/merges","archive_url":"https://api.github.com/repos/ixth/webpack-touch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ixth/webpack-touch/downloads","issues_url":"https://api.github.com/repos/ixth/webpack-touch/issues{/number}","pulls_url":"https://api.github.com/repos/ixth/webpack-touch/pulls{/number}","milestones_url":"https://api.github.com/repos/ixth/webpack-touch/milestones{/number}","notifications_url":"https://api.github.com/repos/ixth/webpack-touch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ixth/webpack-touch/labels{/name}","releases_url":"https://api.github.com/repos/ixth/webpack-touch/releases{/id}","deployments_url":"https://api.github.com/repos/ixth/webpack-touch/deployments","created_at":"2018-04-04T17:07:17Z","updated_at":"2018-04-05T10:33:21Z","pushed_at":"2018-04-08T11:39:49Z","git_url":"git://github.com/ixth/webpack-touch.git","ssh_url":"git@github.com:ixth/webpack-touch.git","clone_url":"https://github.com/ixth/webpack-touch.git","svn_url":"https://github.com/ixth/webpack-touch","homepage":"","size":7,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"vanng822:master","ref":"master","sha":"118f8b6c976feb3a1f0d86629d18270a9f4c406e","user":{"login":"vanng822","id":1191756,"avatar_url":"https://avatars1.githubusercontent.com/u/1191756?v=4","gravatar_id":"","url":"https://api.github.com/users/vanng822","html_url":"https://github.com/vanng822","followers_url":"https://api.github.com/users/vanng822/followers","following_url":"https://api.github.com/users/vanng822/following{/other_user}","gists_url":"https://api.github.com/users/vanng822/gists{/gist_id}","starred_url":"https://api.github.com/users/vanng822/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vanng822/subscriptions","organizations_url":"https://api.github.com/users/vanng822/orgs","repos_url":"https://api.github.com/users/vanng822/repos","events_url":"https://api.github.com/users/vanng822/events{/privacy}","received_events_url":"https://api.github.com/users/vanng822/received_events","type":"User","site_admin":false},"repo":{"id":65612939,"name":"webpack-touch","full_name":"vanng822/webpack-touch","owner":{"login":"vanng822","id":1191756,"avatar_url":"https://avatars1.githubusercontent.com/u/1191756?v=4","gravatar_id":"","url":"https://api.github.com/users/vanng822","html_url":"https://github.com/vanng822","followers_url":"https://api.github.com/users/vanng822/followers","following_url":"https://api.github.com/users/vanng822/following{/other_user}","gists_url":"https://api.github.com/users/vanng822/gists{/gist_id}","starred_url":"https://api.github.com/users/vanng822/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vanng822/subscriptions","organizations_url":"https://api.github.com/users/vanng822/orgs","repos_url":"https://api.github.com/users/vanng822/repos","events_url":"https://api.github.com/users/vanng822/events{/privacy}","received_events_url":"https://api.github.com/users/vanng822/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vanng822/webpack-touch","description":"Webpack plugin for touching a file when done to tell other process to take action.","fork":false,"url":"https://api.github.com/repos/vanng822/webpack-touch","forks_url":"https://api.github.com/repos/vanng822/webpack-touch/forks","keys_url":"https://api.github.com/repos/vanng822/webpack-touch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vanng822/webpack-touch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vanng822/webpack-touch/teams","hooks_url":"https://api.github.com/repos/vanng822/webpack-touch/hooks","issue_events_url":"https://api.github.com/repos/vanng822/webpack-touch/issues/events{/number}","events_url":"https://api.github.com/repos/vanng822/webpack-touch/events","assignees_url":"https://api.github.com/repos/vanng822/webpack-touch/assignees{/user}","branches_url":"https://api.github.com/repos/vanng822/webpack-touch/branches{/branch}","tags_url":"https://api.github.com/repos/vanng822/webpack-touch/tags","blobs_url":"https://api.github.com/repos/vanng822/webpack-touch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vanng822/webpack-touch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vanng822/webpack-touch/git/refs{/sha}","trees_url":"https://api.github.com/repos/vanng822/webpack-touch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vanng822/webpack-touch/statuses/{sha}","languages_url":"https://api.github.com/repos/vanng822/webpack-touch/languages","stargazers_url":"https://api.github.com/repos/vanng822/webpack-touch/stargazers","contributors_url":"https://api.github.com/repos/vanng822/webpack-touch/contributors","subscribers_url":"https://api.github.com/repos/vanng822/webpack-touch/subscribers","subscription_url":"https://api.github.com/repos/vanng822/webpack-touch/subscription","commits_url":"https://api.github.com/repos/vanng822/webpack-touch/commits{/sha}","git_commits_url":"https://api.github.com/repos/vanng822/webpack-touch/git/commits{/sha}","comments_url":"https://api.github.com/repos/vanng822/webpack-touch/comments{/number}","issue_comment_url":"https://api.github.com/repos/vanng822/webpack-touch/issues/comments{/number}","contents_url":"https://api.github.com/repos/vanng822/webpack-touch/contents/{+path}","compare_url":"https://api.github.com/repos/vanng822/webpack-touch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vanng822/webpack-touch/merges","archive_url":"https://api.github.com/repos/vanng822/webpack-touch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vanng822/webpack-touch/downloads","issues_url":"https://api.github.com/repos/vanng822/webpack-touch/issues{/number}","pulls_url":"https://api.github.com/repos/vanng822/webpack-touch/pulls{/number}","milestones_url":"https://api.github.com/repos/vanng822/webpack-touch/milestones{/number}","notifications_url":"https://api.github.com/repos/vanng822/webpack-touch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vanng822/webpack-touch/labels{/name}","releases_url":"https://api.github.com/repos/vanng822/webpack-touch/releases{/id}","deployments_url":"https://api.github.com/repos/vanng822/webpack-touch/deployments","created_at":"2016-08-13T10:50:17Z","updated_at":"2018-04-05T19:23:21Z","pushed_at":"2018-04-08T11:39:51Z","git_url":"git://github.com/vanng822/webpack-touch.git","ssh_url":"git@github.com:vanng822/webpack-touch.git","clone_url":"https://github.com/vanng822/webpack-touch.git","svn_url":"https://github.com/vanng822/webpack-touch","homepage":"","size":6,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"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":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/vanng822/webpack-touch/pulls/3"},"html":{"href":"https://github.com/vanng822/webpack-touch/pull/3"},"issue":{"href":"https://api.github.com/repos/vanng822/webpack-touch/issues/3"},"comments":{"href":"https://api.github.com/repos/vanng822/webpack-touch/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/vanng822/webpack-touch/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/vanng822/webpack-touch/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/vanng822/webpack-touch/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/vanng822/webpack-touch/statuses/b987ea9aa25170bca736b75e5fd160aba6c47322"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"ixth"}}