{"action":"created","comment":{"url":"https://api.github.com/repos/Wiredcraft/test-backend/pulls/comments/125392720","pull_request_review_id":47776320,"id":125392720,"diff_hunk":"@@ -0,0 +1,259 @@\n+/*\n+* @Author: alutun\n+* @Date:   2017-07-03 14:01:38\n+* @Last Modified by:   alutun\n+* @Last Modified time: 2017-07-03 16:19:16\n+*/\n+\n+var supertest = require(\"supertest\");\n+var should = require(\"should\");\n+var dateFormat = require('dateformat');\n+var now = new Date();\n+var util = require('util');\n+\n+var server = supertest.agent(\"http://localhost:3000\");\n+\n+var savedId;\n+// UNIT test begin\n+\n+describe(\"Basic test\",function(){\n+  it(\"should return home page\",function(done){\n+    // Test home page API\n+    server\n+    .get(\"/\")\n+    .expect(\"Content-type\",/json/)\n+    .expect(200) // THis is HTTP response\n+    .end(function(err,res){\n+      // HTTP status should be 200\n+      res.status.should.equal(200);\n+      done();\n+    });\n+  });\n+\n+  it(\"Should return 404 for wrong endpoint\", function(done){\n+  \tserver\n+  \t.get(\"/random\")\n+    .expect(404)\n+    .end(function(err,res){\n+      res.status.should.equal(404);\n+      done();\n+  \t});\n+   });\n+});\n+\n+describe(\"PUT /user\",function(){\n+\n+\tit(\"Simple Put Test\", function(done){\n+\t\tserver\n+\t\t.post(\"/user\")\n+\t \t.send({name: \"toto\", dob: dateFormat(now, \"isoDateTime\"), address: \"Shanghai\", description: \"This user is a test\"})\n+\t\t.expect(\"Content-type\",/json/)\n+\t    .expect(200)\n+\t    .end(function(err,res){\n+\t      res.status.should.equal(200);\n+\t      // console.log(\"res body is : \" + util.inspect(res.body));\n+\t      res.body.name.should.equal(\"toto\");\n+\t      res.body.description.should.equal(\"This user is a test\");\n+\t      res.body.address.should.equal(\"Shanghai\");\n+\t      res.body.should.have.property(\"id\").which.is.a.Number();\n+\t      savedId = res.body.id;","path":"test/test.js","position":59,"original_position":59,"commit_id":"19de100340100d275d4b98eda28bb728dfa21fd3","original_commit_id":"19de100340100d275d4b98eda28bb728dfa21fd3","user":{"login":"Alutun","id":7424187,"avatar_url":"https://avatars0.githubusercontent.com/u/7424187?v=3","gravatar_id":"","url":"https://api.github.com/users/Alutun","html_url":"https://github.com/Alutun","followers_url":"https://api.github.com/users/Alutun/followers","following_url":"https://api.github.com/users/Alutun/following{/other_user}","gists_url":"https://api.github.com/users/Alutun/gists{/gist_id}","starred_url":"https://api.github.com/users/Alutun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Alutun/subscriptions","organizations_url":"https://api.github.com/users/Alutun/orgs","repos_url":"https://api.github.com/users/Alutun/repos","events_url":"https://api.github.com/users/Alutun/events{/privacy}","received_events_url":"https://api.github.com/users/Alutun/received_events","type":"User","site_admin":false},"body":"Hello @xavierchow let me rephrase me your comment to make sure I understand your point before I submit a commit .\r\n\r\nYou mean that because `saveId` is defined in the global scope, it's an issue because that link the different batch of test together because they rely on each other result. Is that right ? ","created_at":"2017-07-04T05:42:46Z","updated_at":"2017-07-04T05:42:46Z","html_url":"https://github.com/Wiredcraft/test-backend/pull/11#discussion_r125392720","pull_request_url":"https://api.github.com/repos/Wiredcraft/test-backend/pulls/11","_links":{"self":{"href":"https://api.github.com/repos/Wiredcraft/test-backend/pulls/comments/125392720"},"html":{"href":"https://github.com/Wiredcraft/test-backend/pull/11#discussion_r125392720"},"pull_request":{"href":"https://api.github.com/repos/Wiredcraft/test-backend/pulls/11"}}},"pull_request":{"url":"https://api.github.com/repos/Wiredcraft/test-backend/pulls/11","id":128587659,"html_url":"https://github.com/Wiredcraft/test-backend/pull/11","diff_url":"https://github.com/Wiredcraft/test-backend/pull/11.diff","patch_url":"https://github.com/Wiredcraft/test-backend/pull/11.patch","issue_url":"https://api.github.com/repos/Wiredcraft/test-backend/issues/11","number":11,"state":"open","locked":false,"title":"Test Backend - Alexis Lutun First version","user":{"login":"Alutun","id":7424187,"avatar_url":"https://avatars0.githubusercontent.com/u/7424187?v=3","gravatar_id":"","url":"https://api.github.com/users/Alutun","html_url":"https://github.com/Alutun","followers_url":"https://api.github.com/users/Alutun/followers","following_url":"https://api.github.com/users/Alutun/following{/other_user}","gists_url":"https://api.github.com/users/Alutun/gists{/gist_id}","starred_url":"https://api.github.com/users/Alutun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Alutun/subscriptions","organizations_url":"https://api.github.com/users/Alutun/orgs","repos_url":"https://api.github.com/users/Alutun/repos","events_url":"https://api.github.com/users/Alutun/events{/privacy}","received_events_url":"https://api.github.com/users/Alutun/received_events","type":"User","site_admin":false},"body":"Please refer to README for all the information. \r\nIf you have any questions, remarks or suggestions, feel free to let me know\r\n\r\nI'm not sure who to tag so I tag @makara since we meet each other.","created_at":"2017-07-03T09:29:09Z","updated_at":"2017-07-04T05:42:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"77c618bc8366fd23dcb4e7371de679db69a4d817","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/Wiredcraft/test-backend/pulls/11/commits","review_comments_url":"https://api.github.com/repos/Wiredcraft/test-backend/pulls/11/comments","review_comment_url":"https://api.github.com/repos/Wiredcraft/test-backend/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Wiredcraft/test-backend/issues/11/comments","statuses_url":"https://api.github.com/repos/Wiredcraft/test-backend/statuses/19de100340100d275d4b98eda28bb728dfa21fd3","head":{"label":"Alutun:master","ref":"master","sha":"19de100340100d275d4b98eda28bb728dfa21fd3","user":{"login":"Alutun","id":7424187,"avatar_url":"https://avatars0.githubusercontent.com/u/7424187?v=3","gravatar_id":"","url":"https://api.github.com/users/Alutun","html_url":"https://github.com/Alutun","followers_url":"https://api.github.com/users/Alutun/followers","following_url":"https://api.github.com/users/Alutun/following{/other_user}","gists_url":"https://api.github.com/users/Alutun/gists{/gist_id}","starred_url":"https://api.github.com/users/Alutun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Alutun/subscriptions","organizations_url":"https://api.github.com/users/Alutun/orgs","repos_url":"https://api.github.com/users/Alutun/repos","events_url":"https://api.github.com/users/Alutun/events{/privacy}","received_events_url":"https://api.github.com/users/Alutun/received_events","type":"User","site_admin":false},"repo":{"id":95859206,"name":"test-backend","full_name":"Alutun/test-backend","owner":{"login":"Alutun","id":7424187,"avatar_url":"https://avatars0.githubusercontent.com/u/7424187?v=3","gravatar_id":"","url":"https://api.github.com/users/Alutun","html_url":"https://github.com/Alutun","followers_url":"https://api.github.com/users/Alutun/followers","following_url":"https://api.github.com/users/Alutun/following{/other_user}","gists_url":"https://api.github.com/users/Alutun/gists{/gist_id}","starred_url":"https://api.github.com/users/Alutun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Alutun/subscriptions","organizations_url":"https://api.github.com/users/Alutun/orgs","repos_url":"https://api.github.com/users/Alutun/repos","events_url":"https://api.github.com/users/Alutun/events{/privacy}","received_events_url":"https://api.github.com/users/Alutun/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Alutun/test-backend","description":null,"fork":true,"url":"https://api.github.com/repos/Alutun/test-backend","forks_url":"https://api.github.com/repos/Alutun/test-backend/forks","keys_url":"https://api.github.com/repos/Alutun/test-backend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Alutun/test-backend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Alutun/test-backend/teams","hooks_url":"https://api.github.com/repos/Alutun/test-backend/hooks","issue_events_url":"https://api.github.com/repos/Alutun/test-backend/issues/events{/number}","events_url":"https://api.github.com/repos/Alutun/test-backend/events","assignees_url":"https://api.github.com/repos/Alutun/test-backend/assignees{/user}","branches_url":"https://api.github.com/repos/Alutun/test-backend/branches{/branch}","tags_url":"https://api.github.com/repos/Alutun/test-backend/tags","blobs_url":"https://api.github.com/repos/Alutun/test-backend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Alutun/test-backend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Alutun/test-backend/git/refs{/sha}","trees_url":"https://api.github.com/repos/Alutun/test-backend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Alutun/test-backend/statuses/{sha}","languages_url":"https://api.github.com/repos/Alutun/test-backend/languages","stargazers_url":"https://api.github.com/repos/Alutun/test-backend/stargazers","contributors_url":"https://api.github.com/repos/Alutun/test-backend/contributors","subscribers_url":"https://api.github.com/repos/Alutun/test-backend/subscribers","subscription_url":"https://api.github.com/repos/Alutun/test-backend/subscription","commits_url":"https://api.github.com/repos/Alutun/test-backend/commits{/sha}","git_commits_url":"https://api.github.com/repos/Alutun/test-backend/git/commits{/sha}","comments_url":"https://api.github.com/repos/Alutun/test-backend/comments{/number}","issue_comment_url":"https://api.github.com/repos/Alutun/test-backend/issues/comments{/number}","contents_url":"https://api.github.com/repos/Alutun/test-backend/contents/{+path}","compare_url":"https://api.github.com/repos/Alutun/test-backend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Alutun/test-backend/merges","archive_url":"https://api.github.com/repos/Alutun/test-backend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Alutun/test-backend/downloads","issues_url":"https://api.github.com/repos/Alutun/test-backend/issues{/number}","pulls_url":"https://api.github.com/repos/Alutun/test-backend/pulls{/number}","milestones_url":"https://api.github.com/repos/Alutun/test-backend/milestones{/number}","notifications_url":"https://api.github.com/repos/Alutun/test-backend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Alutun/test-backend/labels{/name}","releases_url":"https://api.github.com/repos/Alutun/test-backend/releases{/id}","deployments_url":"https://api.github.com/repos/Alutun/test-backend/deployments","created_at":"2017-06-30T07:01:39Z","updated_at":"2017-07-03T09:23:20Z","pushed_at":"2017-07-03T09:23:19Z","git_url":"git://github.com/Alutun/test-backend.git","ssh_url":"git@github.com:Alutun/test-backend.git","clone_url":"https://github.com/Alutun/test-backend.git","svn_url":"https://github.com/Alutun/test-backend","homepage":null,"size":1955,"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,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Wiredcraft:master","ref":"master","sha":"c69b2eb9f562f402130443fc50d3ddbc3f5465eb","user":{"login":"Wiredcraft","id":496772,"avatar_url":"https://avatars0.githubusercontent.com/u/496772?v=3","gravatar_id":"","url":"https://api.github.com/users/Wiredcraft","html_url":"https://github.com/Wiredcraft","followers_url":"https://api.github.com/users/Wiredcraft/followers","following_url":"https://api.github.com/users/Wiredcraft/following{/other_user}","gists_url":"https://api.github.com/users/Wiredcraft/gists{/gist_id}","starred_url":"https://api.github.com/users/Wiredcraft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wiredcraft/subscriptions","organizations_url":"https://api.github.com/users/Wiredcraft/orgs","repos_url":"https://api.github.com/users/Wiredcraft/repos","events_url":"https://api.github.com/users/Wiredcraft/events{/privacy}","received_events_url":"https://api.github.com/users/Wiredcraft/received_events","type":"Organization","site_admin":false},"repo":{"id":36496157,"name":"test-backend","full_name":"Wiredcraft/test-backend","owner":{"login":"Wiredcraft","id":496772,"avatar_url":"https://avatars0.githubusercontent.com/u/496772?v=3","gravatar_id":"","url":"https://api.github.com/users/Wiredcraft","html_url":"https://github.com/Wiredcraft","followers_url":"https://api.github.com/users/Wiredcraft/followers","following_url":"https://api.github.com/users/Wiredcraft/following{/other_user}","gists_url":"https://api.github.com/users/Wiredcraft/gists{/gist_id}","starred_url":"https://api.github.com/users/Wiredcraft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wiredcraft/subscriptions","organizations_url":"https://api.github.com/users/Wiredcraft/orgs","repos_url":"https://api.github.com/users/Wiredcraft/repos","events_url":"https://api.github.com/users/Wiredcraft/events{/privacy}","received_events_url":"https://api.github.com/users/Wiredcraft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Wiredcraft/test-backend","description":null,"fork":false,"url":"https://api.github.com/repos/Wiredcraft/test-backend","forks_url":"https://api.github.com/repos/Wiredcraft/test-backend/forks","keys_url":"https://api.github.com/repos/Wiredcraft/test-backend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Wiredcraft/test-backend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Wiredcraft/test-backend/teams","hooks_url":"https://api.github.com/repos/Wiredcraft/test-backend/hooks","issue_events_url":"https://api.github.com/repos/Wiredcraft/test-backend/issues/events{/number}","events_url":"https://api.github.com/repos/Wiredcraft/test-backend/events","assignees_url":"https://api.github.com/repos/Wiredcraft/test-backend/assignees{/user}","branches_url":"https://api.github.com/repos/Wiredcraft/test-backend/branches{/branch}","tags_url":"https://api.github.com/repos/Wiredcraft/test-backend/tags","blobs_url":"https://api.github.com/repos/Wiredcraft/test-backend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Wiredcraft/test-backend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Wiredcraft/test-backend/git/refs{/sha}","trees_url":"https://api.github.com/repos/Wiredcraft/test-backend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Wiredcraft/test-backend/statuses/{sha}","languages_url":"https://api.github.com/repos/Wiredcraft/test-backend/languages","stargazers_url":"https://api.github.com/repos/Wiredcraft/test-backend/stargazers","contributors_url":"https://api.github.com/repos/Wiredcraft/test-backend/contributors","subscribers_url":"https://api.github.com/repos/Wiredcraft/test-backend/subscribers","subscription_url":"https://api.github.com/repos/Wiredcraft/test-backend/subscription","commits_url":"https://api.github.com/repos/Wiredcraft/test-backend/commits{/sha}","git_commits_url":"https://api.github.com/repos/Wiredcraft/test-backend/git/commits{/sha}","comments_url":"https://api.github.com/repos/Wiredcraft/test-backend/comments{/number}","issue_comment_url":"https://api.github.com/repos/Wiredcraft/test-backend/issues/comments{/number}","contents_url":"https://api.github.com/repos/Wiredcraft/test-backend/contents/{+path}","compare_url":"https://api.github.com/repos/Wiredcraft/test-backend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Wiredcraft/test-backend/merges","archive_url":"https://api.github.com/repos/Wiredcraft/test-backend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Wiredcraft/test-backend/downloads","issues_url":"https://api.github.com/repos/Wiredcraft/test-backend/issues{/number}","pulls_url":"https://api.github.com/repos/Wiredcraft/test-backend/pulls{/number}","milestones_url":"https://api.github.com/repos/Wiredcraft/test-backend/milestones{/number}","notifications_url":"https://api.github.com/repos/Wiredcraft/test-backend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Wiredcraft/test-backend/labels{/name}","releases_url":"https://api.github.com/repos/Wiredcraft/test-backend/releases{/id}","deployments_url":"https://api.github.com/repos/Wiredcraft/test-backend/deployments","created_at":"2015-05-29T09:59:54Z","updated_at":"2017-07-04T05:38:46Z","pushed_at":"2017-07-03T09:29:10Z","git_url":"git://github.com/Wiredcraft/test-backend.git","ssh_url":"git@github.com:Wiredcraft/test-backend.git","clone_url":"https://github.com/Wiredcraft/test-backend.git","svn_url":"https://github.com/Wiredcraft/test-backend","homepage":null,"size":1953,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":1,"forks":6,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Wiredcraft/test-backend/pulls/11"},"html":{"href":"https://github.com/Wiredcraft/test-backend/pull/11"},"issue":{"href":"https://api.github.com/repos/Wiredcraft/test-backend/issues/11"},"comments":{"href":"https://api.github.com/repos/Wiredcraft/test-backend/issues/11/comments"},"review_comments":{"href":"https://api.github.com/repos/Wiredcraft/test-backend/pulls/11/comments"},"review_comment":{"href":"https://api.github.com/repos/Wiredcraft/test-backend/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Wiredcraft/test-backend/pulls/11/commits"},"statuses":{"href":"https://api.github.com/repos/Wiredcraft/test-backend/statuses/19de100340100d275d4b98eda28bb728dfa21fd3"}}}}
{"actor":{"display_login":"Alutun"}}