{"action":"created","comment":{"url":"https://api.github.com/repos/fastify/fastify-cli/pulls/comments/207788772","pull_request_review_id":143468177,"id":207788772,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNzc4ODc3Mg==","diff_hunk":"@@ -433,3 +402,62 @@ test('should start the server listening on 0.0.0.0 when runing in docker', t =>\n     t.strictEqual(fastify.server.address().address, '0.0.0.0')\n   })\n })\n+\n+test('should start the server with watch options that the child process restart when directory changed', t => {\n+  t.plan(5)\n+\n+  const tmpjs = path.resolve(baseFilename + '.js')\n+  fs.writeFileSync(tmpjs, 'hello world')\n+\n+  setTimeout(function () {\n+    const argv = [ '-p', '3000', '-w', './examples/plugin.js' ]\n+    const fastifyEmitter = start.start(argv)\n+\n+    t.tearDown(() => {\n+      if (fs.existsSync(tmpjs)) {\n+        fs.unlinkSync(tmpjs)\n+      }\n+      fastifyEmitter.emit('close')\n+    })\n+\n+    fastifyEmitter.on('start', () => {\n+      t.pass('should receive start event')\n+      setTimeout(function () {\n+        t.pass('touch tmpjs')\n+        // fastifyEmitter.emit('ready')\n+        // fastifyEmitter.emit('restart')\n+        exec(`touch ${tmpjs}`) // chokidar watch can't caught change event in travis CI, but local test is all ok. you can remove annotation in local environment.\n+      }, 1500)\n+    })\n+\n+    fastifyEmitter.on('restart', () => {\n+      t.pass('should receive restart event')\n+    })\n+\n+    fastifyEmitter.on('ready', () => {\n+      t.pass('should receive ready event')\n+    })\n+  }, 500)","path":"test/start.js","position":297,"original_position":297,"commit_id":"42e9052e46715ca2c0297efba83a1f6e50e395c8","original_commit_id":"42e9052e46715ca2c0297efba83a1f6e50e395c8","user":{"login":"mcollina","id":52195,"node_id":"MDQ6VXNlcjUyMTk1","avatar_url":"https://avatars0.githubusercontent.com/u/52195?v=4","gravatar_id":"","url":"https://api.github.com/users/mcollina","html_url":"https://github.com/mcollina","followers_url":"https://api.github.com/users/mcollina/followers","following_url":"https://api.github.com/users/mcollina/following{/other_user}","gists_url":"https://api.github.com/users/mcollina/gists{/gist_id}","starred_url":"https://api.github.com/users/mcollina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcollina/subscriptions","organizations_url":"https://api.github.com/users/mcollina/orgs","repos_url":"https://api.github.com/users/mcollina/repos","events_url":"https://api.github.com/users/mcollina/events{/privacy}","received_events_url":"https://api.github.com/users/mcollina/received_events","type":"User","site_admin":false},"body":"Can you remove the various setTimeout? It seems that chokidar itself has some problem with its CI. We can skip these tests on Travis I presume. What do you think @delvedor?","created_at":"2018-08-06T06:53:50Z","updated_at":"2018-08-06T06:55:22Z","html_url":"https://github.com/fastify/fastify-cli/pull/92#discussion_r207788772","pull_request_url":"https://api.github.com/repos/fastify/fastify-cli/pulls/92","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/fastify/fastify-cli/pulls/comments/207788772"},"html":{"href":"https://github.com/fastify/fastify-cli/pull/92#discussion_r207788772"},"pull_request":{"href":"https://api.github.com/repos/fastify/fastify-cli/pulls/92"}}},"pull_request":{"url":"https://api.github.com/repos/fastify/fastify-cli/pulls/92","id":204834501,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA0ODM0NTAx","html_url":"https://github.com/fastify/fastify-cli/pull/92","diff_url":"https://github.com/fastify/fastify-cli/pull/92.diff","patch_url":"https://github.com/fastify/fastify-cli/pull/92.patch","issue_url":"https://api.github.com/repos/fastify/fastify-cli/issues/92","number":92,"state":"open","locked":false,"title":"added watch env var (#91)","user":{"login":"gaogao1030","id":4404315,"node_id":"MDQ6VXNlcjQ0MDQzMTU=","avatar_url":"https://avatars1.githubusercontent.com/u/4404315?v=4","gravatar_id":"","url":"https://api.github.com/users/gaogao1030","html_url":"https://github.com/gaogao1030","followers_url":"https://api.github.com/users/gaogao1030/followers","following_url":"https://api.github.com/users/gaogao1030/following{/other_user}","gists_url":"https://api.github.com/users/gaogao1030/gists{/gist_id}","starred_url":"https://api.github.com/users/gaogao1030/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gaogao1030/subscriptions","organizations_url":"https://api.github.com/users/gaogao1030/orgs","repos_url":"https://api.github.com/users/gaogao1030/repos","events_url":"https://api.github.com/users/gaogao1030/events{/privacy}","received_events_url":"https://api.github.com/users/gaogao1030/received_events","type":"User","site_admin":false},"body":"* added watch env var\r\n\r\n* change test/start.js\r\n\r\n* updated help text","created_at":"2018-07-30T15:02:55Z","updated_at":"2018-08-06T06:55:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6ee3d61670c6ad8e2ac03e1248809957623fc1b0","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/fastify/fastify-cli/pulls/92/commits","review_comments_url":"https://api.github.com/repos/fastify/fastify-cli/pulls/92/comments","review_comment_url":"https://api.github.com/repos/fastify/fastify-cli/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fastify/fastify-cli/issues/92/comments","statuses_url":"https://api.github.com/repos/fastify/fastify-cli/statuses/42e9052e46715ca2c0297efba83a1f6e50e395c8","head":{"label":"gaogao1030:fix/issue#91","ref":"fix/issue#91","sha":"42e9052e46715ca2c0297efba83a1f6e50e395c8","user":{"login":"gaogao1030","id":4404315,"node_id":"MDQ6VXNlcjQ0MDQzMTU=","avatar_url":"https://avatars1.githubusercontent.com/u/4404315?v=4","gravatar_id":"","url":"https://api.github.com/users/gaogao1030","html_url":"https://github.com/gaogao1030","followers_url":"https://api.github.com/users/gaogao1030/followers","following_url":"https://api.github.com/users/gaogao1030/following{/other_user}","gists_url":"https://api.github.com/users/gaogao1030/gists{/gist_id}","starred_url":"https://api.github.com/users/gaogao1030/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gaogao1030/subscriptions","organizations_url":"https://api.github.com/users/gaogao1030/orgs","repos_url":"https://api.github.com/users/gaogao1030/repos","events_url":"https://api.github.com/users/gaogao1030/events{/privacy}","received_events_url":"https://api.github.com/users/gaogao1030/received_events","type":"User","site_admin":false},"repo":{"id":142890991,"node_id":"MDEwOlJlcG9zaXRvcnkxNDI4OTA5OTE=","name":"fastify-cli","full_name":"gaogao1030/fastify-cli","owner":{"login":"gaogao1030","id":4404315,"node_id":"MDQ6VXNlcjQ0MDQzMTU=","avatar_url":"https://avatars1.githubusercontent.com/u/4404315?v=4","gravatar_id":"","url":"https://api.github.com/users/gaogao1030","html_url":"https://github.com/gaogao1030","followers_url":"https://api.github.com/users/gaogao1030/followers","following_url":"https://api.github.com/users/gaogao1030/following{/other_user}","gists_url":"https://api.github.com/users/gaogao1030/gists{/gist_id}","starred_url":"https://api.github.com/users/gaogao1030/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gaogao1030/subscriptions","organizations_url":"https://api.github.com/users/gaogao1030/orgs","repos_url":"https://api.github.com/users/gaogao1030/repos","events_url":"https://api.github.com/users/gaogao1030/events{/privacy}","received_events_url":"https://api.github.com/users/gaogao1030/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gaogao1030/fastify-cli","description":"Run a fastify route with one command!","fork":true,"url":"https://api.github.com/repos/gaogao1030/fastify-cli","forks_url":"https://api.github.com/repos/gaogao1030/fastify-cli/forks","keys_url":"https://api.github.com/repos/gaogao1030/fastify-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gaogao1030/fastify-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gaogao1030/fastify-cli/teams","hooks_url":"https://api.github.com/repos/gaogao1030/fastify-cli/hooks","issue_events_url":"https://api.github.com/repos/gaogao1030/fastify-cli/issues/events{/number}","events_url":"https://api.github.com/repos/gaogao1030/fastify-cli/events","assignees_url":"https://api.github.com/repos/gaogao1030/fastify-cli/assignees{/user}","branches_url":"https://api.github.com/repos/gaogao1030/fastify-cli/branches{/branch}","tags_url":"https://api.github.com/repos/gaogao1030/fastify-cli/tags","blobs_url":"https://api.github.com/repos/gaogao1030/fastify-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gaogao1030/fastify-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gaogao1030/fastify-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/gaogao1030/fastify-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gaogao1030/fastify-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/gaogao1030/fastify-cli/languages","stargazers_url":"https://api.github.com/repos/gaogao1030/fastify-cli/stargazers","contributors_url":"https://api.github.com/repos/gaogao1030/fastify-cli/contributors","subscribers_url":"https://api.github.com/repos/gaogao1030/fastify-cli/subscribers","subscription_url":"https://api.github.com/repos/gaogao1030/fastify-cli/subscription","commits_url":"https://api.github.com/repos/gaogao1030/fastify-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/gaogao1030/fastify-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/gaogao1030/fastify-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/gaogao1030/fastify-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/gaogao1030/fastify-cli/contents/{+path}","compare_url":"https://api.github.com/repos/gaogao1030/fastify-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gaogao1030/fastify-cli/merges","archive_url":"https://api.github.com/repos/gaogao1030/fastify-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gaogao1030/fastify-cli/downloads","issues_url":"https://api.github.com/repos/gaogao1030/fastify-cli/issues{/number}","pulls_url":"https://api.github.com/repos/gaogao1030/fastify-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/gaogao1030/fastify-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/gaogao1030/fastify-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gaogao1030/fastify-cli/labels{/name}","releases_url":"https://api.github.com/repos/gaogao1030/fastify-cli/releases{/id}","deployments_url":"https://api.github.com/repos/gaogao1030/fastify-cli/deployments","created_at":"2018-07-30T15:00:06Z","updated_at":"2018-07-30T15:00:08Z","pushed_at":"2018-08-06T06:04:38Z","git_url":"git://github.com/gaogao1030/fastify-cli.git","ssh_url":"git@github.com:gaogao1030/fastify-cli.git","clone_url":"https://github.com/gaogao1030/fastify-cli.git","svn_url":"https://github.com/gaogao1030/fastify-cli","homepage":"","size":109,"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","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"fastify:master","ref":"master","sha":"cfbd1802b7c5b5a82ab5f685365bb9157d542fc6","user":{"login":"fastify","id":24939410,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI0OTM5NDEw","avatar_url":"https://avatars3.githubusercontent.com/u/24939410?v=4","gravatar_id":"","url":"https://api.github.com/users/fastify","html_url":"https://github.com/fastify","followers_url":"https://api.github.com/users/fastify/followers","following_url":"https://api.github.com/users/fastify/following{/other_user}","gists_url":"https://api.github.com/users/fastify/gists{/gist_id}","starred_url":"https://api.github.com/users/fastify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fastify/subscriptions","organizations_url":"https://api.github.com/users/fastify/orgs","repos_url":"https://api.github.com/users/fastify/repos","events_url":"https://api.github.com/users/fastify/events{/privacy}","received_events_url":"https://api.github.com/users/fastify/received_events","type":"Organization","site_admin":false},"repo":{"id":75235598,"node_id":"MDEwOlJlcG9zaXRvcnk3NTIzNTU5OA==","name":"fastify-cli","full_name":"fastify/fastify-cli","owner":{"login":"fastify","id":24939410,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI0OTM5NDEw","avatar_url":"https://avatars3.githubusercontent.com/u/24939410?v=4","gravatar_id":"","url":"https://api.github.com/users/fastify","html_url":"https://github.com/fastify","followers_url":"https://api.github.com/users/fastify/followers","following_url":"https://api.github.com/users/fastify/following{/other_user}","gists_url":"https://api.github.com/users/fastify/gists{/gist_id}","starred_url":"https://api.github.com/users/fastify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fastify/subscriptions","organizations_url":"https://api.github.com/users/fastify/orgs","repos_url":"https://api.github.com/users/fastify/repos","events_url":"https://api.github.com/users/fastify/events{/privacy}","received_events_url":"https://api.github.com/users/fastify/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fastify/fastify-cli","description":"Run a fastify route with one command!","fork":false,"url":"https://api.github.com/repos/fastify/fastify-cli","forks_url":"https://api.github.com/repos/fastify/fastify-cli/forks","keys_url":"https://api.github.com/repos/fastify/fastify-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fastify/fastify-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fastify/fastify-cli/teams","hooks_url":"https://api.github.com/repos/fastify/fastify-cli/hooks","issue_events_url":"https://api.github.com/repos/fastify/fastify-cli/issues/events{/number}","events_url":"https://api.github.com/repos/fastify/fastify-cli/events","assignees_url":"https://api.github.com/repos/fastify/fastify-cli/assignees{/user}","branches_url":"https://api.github.com/repos/fastify/fastify-cli/branches{/branch}","tags_url":"https://api.github.com/repos/fastify/fastify-cli/tags","blobs_url":"https://api.github.com/repos/fastify/fastify-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fastify/fastify-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fastify/fastify-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/fastify/fastify-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fastify/fastify-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/fastify/fastify-cli/languages","stargazers_url":"https://api.github.com/repos/fastify/fastify-cli/stargazers","contributors_url":"https://api.github.com/repos/fastify/fastify-cli/contributors","subscribers_url":"https://api.github.com/repos/fastify/fastify-cli/subscribers","subscription_url":"https://api.github.com/repos/fastify/fastify-cli/subscription","commits_url":"https://api.github.com/repos/fastify/fastify-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/fastify/fastify-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/fastify/fastify-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/fastify/fastify-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/fastify/fastify-cli/contents/{+path}","compare_url":"https://api.github.com/repos/fastify/fastify-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fastify/fastify-cli/merges","archive_url":"https://api.github.com/repos/fastify/fastify-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fastify/fastify-cli/downloads","issues_url":"https://api.github.com/repos/fastify/fastify-cli/issues{/number}","pulls_url":"https://api.github.com/repos/fastify/fastify-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/fastify/fastify-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/fastify/fastify-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fastify/fastify-cli/labels{/name}","releases_url":"https://api.github.com/repos/fastify/fastify-cli/releases{/id}","deployments_url":"https://api.github.com/repos/fastify/fastify-cli/deployments","created_at":"2016-11-30T23:13:19Z","updated_at":"2018-08-03T07:18:00Z","pushed_at":"2018-08-06T06:04:40Z","git_url":"git://github.com/fastify/fastify-cli.git","ssh_url":"git@github.com:fastify/fastify-cli.git","clone_url":"https://github.com/fastify/fastify-cli.git","svn_url":"https://github.com/fastify/fastify-cli","homepage":"","size":107,"stargazers_count":55,"watchers_count":55,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"archived":false,"open_issues_count":11,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":14,"open_issues":11,"watchers":55,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fastify/fastify-cli/pulls/92"},"html":{"href":"https://github.com/fastify/fastify-cli/pull/92"},"issue":{"href":"https://api.github.com/repos/fastify/fastify-cli/issues/92"},"comments":{"href":"https://api.github.com/repos/fastify/fastify-cli/issues/92/comments"},"review_comments":{"href":"https://api.github.com/repos/fastify/fastify-cli/pulls/92/comments"},"review_comment":{"href":"https://api.github.com/repos/fastify/fastify-cli/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fastify/fastify-cli/pulls/92/commits"},"statuses":{"href":"https://api.github.com/repos/fastify/fastify-cli/statuses/42e9052e46715ca2c0297efba83a1f6e50e395c8"}},"author_association":"NONE"}}
{"actor":{"display_login":"mcollina"}}