{"action":"created","comment":{"url":"https://api.github.com/repos/not-nexus/shelf-lib-js/pulls/comments/90919827","pull_request_review_id":11051397,"id":90919827,"diff_hunk":"@@ -0,0 +1,134 @@\n+\"use strict\";\n+\n+describe(\"lib/response-handler\", () => {\n+    var bluebird, error, logger, parseLinkHeader, responseHandler, ShelfError, URI;\n+\n+    bluebird = require(\"bluebird\");\n+    error = require(\"../../lib/error\")();\n+    logger = require(\"../../lib/logger\")();\n+    parseLinkHeader = require(\"parse-link-header\");\n+    ShelfError = require(\"../../lib/shelf-error\")();\n+    URI = require(\"urijs\");\n+    responseHandler = require(\"../../lib/response-handler\")(bluebird, error, logger, parseLinkHeader, ShelfError, URI);\n+    describe(\".isErrorCode()\", () => {\n+        it(\"returns false if the status code is within the right range\", () => {\n+            expect(responseHandler.isErrorCode(300)).toBe(false);\n+        });\n+        it(\"returns false if the status code is 200\", () => {\n+            expect(responseHandler.isErrorCode(200)).toBe(false);\n+        });\n+        it(\"returns false if the status code is 201\", () => {\n+            expect(responseHandler.isErrorCode(201)).toBe(false);\n+        });\n+        it(\"returns true if the status code is less than 200\", () => {\n+            expect(responseHandler.isErrorCode(150)).toBe(true);\n+        });\n+        it(\"returns true if the status code is greater than 399\", () => {\n+            expect(responseHandler.isErrorCode(404)).toBe(true);\n+        });\n+    });\n+    describe(\".createErrorForResponse()\", () => {\n+        var errorFromResponse, errorResponse;\n+\n+        it(\"returns any unknown errors\", () => {\n+            errorResponse = {\n+                body: {\n+                    code: \"anUnknownError\"\n+                }\n+            };\n+            errorFromResponse = responseHandler.createErrorForResponse(errorResponse);\n+            expect(errorFromResponse.message).toBe(\"UNKNOWN\");\n+            expect(errorFromResponse.code).toBe(\"UNKNOWN\");\n+        });\n+        it(\"returns a timeout error\", () => {\n+            errorResponse = {\n+                code: \"exampleTimeoutError\"\n+            };\n+            errorFromResponse = responseHandler.createErrorForResponse(errorResponse);\n+            expect(errorFromResponse.message).toBe(\"Socket Timeout\");\n+            expect(errorFromResponse.code).toBe(\"ESOCKETTIMEDOUT\");\n+        });\n+        it(\"returns known errors\", () => {\n+            errorResponse = {\n+                error: \"duplicate_artifact\",\n+                response: {\n+                    body: {\n+                        code: \"duplicate_artifact\",\n+                        message: \"A duplicate artifact error message\"\n+                    }\n+                }\n+            };\n+            errorFromResponse = responseHandler.createErrorForResponse(errorResponse);\n+            expect(errorFromResponse.message).toBe(\"A duplicate artifact error message\");\n+            expect(errorFromResponse.code).toBe(\"DUPLICATE_ARTIFACT\");\n+        });\n+    });\n+    describe(\".handleErrorResponse()\", () => {\n+        it(\"throws errors from responseHandler.createErrorForResponse()\", () => {\n+            spyOn(responseHandler, \"createErrorForResponse\").andReturn(new Error(\"SomeError\"));\n+            expect(() => {\n+                responseHandler.handleErrorResponse();\n+            }).toThrow();\n+        });\n+    });\n+    describe(\".resolveLink()\", () => {\n+        it(\"returns a new URI as a string\", () => {","path":"spec/lib/response-handler.spec.js","position":75,"original_position":75,"commit_id":"3cbb53e8fbe58d236bbaeb346c720c7003575d1a","original_commit_id":"3cbb53e8fbe58d236bbaeb346c720c7003575d1a","user":{"login":"kyle-long","id":1569367,"avatar_url":"https://avatars.githubusercontent.com/u/1569367?v=3","gravatar_id":"","url":"https://api.github.com/users/kyle-long","html_url":"https://github.com/kyle-long","followers_url":"https://api.github.com/users/kyle-long/followers","following_url":"https://api.github.com/users/kyle-long/following{/other_user}","gists_url":"https://api.github.com/users/kyle-long/gists{/gist_id}","starred_url":"https://api.github.com/users/kyle-long/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kyle-long/subscriptions","organizations_url":"https://api.github.com/users/kyle-long/orgs","repos_url":"https://api.github.com/users/kyle-long/repos","events_url":"https://api.github.com/users/kyle-long/events{/privacy}","received_events_url":"https://api.github.com/users/kyle-long/received_events","type":"User","site_admin":false},"body":"Returns a path","created_at":"2016-12-05T17:58:14Z","updated_at":"2016-12-05T17:58:14Z","html_url":"https://github.com/not-nexus/shelf-lib-js/pull/7#discussion_r90919827","pull_request_url":"https://api.github.com/repos/not-nexus/shelf-lib-js/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/not-nexus/shelf-lib-js/pulls/comments/90919827"},"html":{"href":"https://github.com/not-nexus/shelf-lib-js/pull/7#discussion_r90919827"},"pull_request":{"href":"https://api.github.com/repos/not-nexus/shelf-lib-js/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/not-nexus/shelf-lib-js/pulls/7","id":94677835,"html_url":"https://github.com/not-nexus/shelf-lib-js/pull/7","diff_url":"https://github.com/not-nexus/shelf-lib-js/pull/7.diff","patch_url":"https://github.com/not-nexus/shelf-lib-js/pull/7.patch","issue_url":"https://api.github.com/repos/not-nexus/shelf-lib-js/issues/7","number":7,"state":"open","locked":false,"title":"Added tests and a couple other, relatively minor, changes.","user":{"login":"lnagle93","id":13711016,"avatar_url":"https://avatars.githubusercontent.com/u/13711016?v=3","gravatar_id":"","url":"https://api.github.com/users/lnagle93","html_url":"https://github.com/lnagle93","followers_url":"https://api.github.com/users/lnagle93/followers","following_url":"https://api.github.com/users/lnagle93/following{/other_user}","gists_url":"https://api.github.com/users/lnagle93/gists{/gist_id}","starred_url":"https://api.github.com/users/lnagle93/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lnagle93/subscriptions","organizations_url":"https://api.github.com/users/lnagle93/orgs","repos_url":"https://api.github.com/users/lnagle93/repos","events_url":"https://api.github.com/users/lnagle93/events{/privacy}","received_events_url":"https://api.github.com/users/lnagle93/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-11-21T19:15:34Z","updated_at":"2016-12-05T18:04:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"17ed599ab4ad1a8d511202da5050c8d94b21ed5d","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/not-nexus/shelf-lib-js/pulls/7/commits","review_comments_url":"https://api.github.com/repos/not-nexus/shelf-lib-js/pulls/7/comments","review_comment_url":"https://api.github.com/repos/not-nexus/shelf-lib-js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/not-nexus/shelf-lib-js/issues/7/comments","statuses_url":"https://api.github.com/repos/not-nexus/shelf-lib-js/statuses/3cbb53e8fbe58d236bbaeb346c720c7003575d1a","head":{"label":"lnagle93:testing","ref":"testing","sha":"3cbb53e8fbe58d236bbaeb346c720c7003575d1a","user":{"login":"lnagle93","id":13711016,"avatar_url":"https://avatars.githubusercontent.com/u/13711016?v=3","gravatar_id":"","url":"https://api.github.com/users/lnagle93","html_url":"https://github.com/lnagle93","followers_url":"https://api.github.com/users/lnagle93/followers","following_url":"https://api.github.com/users/lnagle93/following{/other_user}","gists_url":"https://api.github.com/users/lnagle93/gists{/gist_id}","starred_url":"https://api.github.com/users/lnagle93/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lnagle93/subscriptions","organizations_url":"https://api.github.com/users/lnagle93/orgs","repos_url":"https://api.github.com/users/lnagle93/repos","events_url":"https://api.github.com/users/lnagle93/events{/privacy}","received_events_url":"https://api.github.com/users/lnagle93/received_events","type":"User","site_admin":false},"repo":{"id":72005108,"name":"shelf-lib-js","full_name":"lnagle93/shelf-lib-js","owner":{"login":"lnagle93","id":13711016,"avatar_url":"https://avatars.githubusercontent.com/u/13711016?v=3","gravatar_id":"","url":"https://api.github.com/users/lnagle93","html_url":"https://github.com/lnagle93","followers_url":"https://api.github.com/users/lnagle93/followers","following_url":"https://api.github.com/users/lnagle93/following{/other_user}","gists_url":"https://api.github.com/users/lnagle93/gists{/gist_id}","starred_url":"https://api.github.com/users/lnagle93/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lnagle93/subscriptions","organizations_url":"https://api.github.com/users/lnagle93/orgs","repos_url":"https://api.github.com/users/lnagle93/repos","events_url":"https://api.github.com/users/lnagle93/events{/privacy}","received_events_url":"https://api.github.com/users/lnagle93/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lnagle93/shelf-lib-js","description":null,"fork":true,"url":"https://api.github.com/repos/lnagle93/shelf-lib-js","forks_url":"https://api.github.com/repos/lnagle93/shelf-lib-js/forks","keys_url":"https://api.github.com/repos/lnagle93/shelf-lib-js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lnagle93/shelf-lib-js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lnagle93/shelf-lib-js/teams","hooks_url":"https://api.github.com/repos/lnagle93/shelf-lib-js/hooks","issue_events_url":"https://api.github.com/repos/lnagle93/shelf-lib-js/issues/events{/number}","events_url":"https://api.github.com/repos/lnagle93/shelf-lib-js/events","assignees_url":"https://api.github.com/repos/lnagle93/shelf-lib-js/assignees{/user}","branches_url":"https://api.github.com/repos/lnagle93/shelf-lib-js/branches{/branch}","tags_url":"https://api.github.com/repos/lnagle93/shelf-lib-js/tags","blobs_url":"https://api.github.com/repos/lnagle93/shelf-lib-js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lnagle93/shelf-lib-js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lnagle93/shelf-lib-js/git/refs{/sha}","trees_url":"https://api.github.com/repos/lnagle93/shelf-lib-js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lnagle93/shelf-lib-js/statuses/{sha}","languages_url":"https://api.github.com/repos/lnagle93/shelf-lib-js/languages","stargazers_url":"https://api.github.com/repos/lnagle93/shelf-lib-js/stargazers","contributors_url":"https://api.github.com/repos/lnagle93/shelf-lib-js/contributors","subscribers_url":"https://api.github.com/repos/lnagle93/shelf-lib-js/subscribers","subscription_url":"https://api.github.com/repos/lnagle93/shelf-lib-js/subscription","commits_url":"https://api.github.com/repos/lnagle93/shelf-lib-js/commits{/sha}","git_commits_url":"https://api.github.com/repos/lnagle93/shelf-lib-js/git/commits{/sha}","comments_url":"https://api.github.com/repos/lnagle93/shelf-lib-js/comments{/number}","issue_comment_url":"https://api.github.com/repos/lnagle93/shelf-lib-js/issues/comments{/number}","contents_url":"https://api.github.com/repos/lnagle93/shelf-lib-js/contents/{+path}","compare_url":"https://api.github.com/repos/lnagle93/shelf-lib-js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lnagle93/shelf-lib-js/merges","archive_url":"https://api.github.com/repos/lnagle93/shelf-lib-js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lnagle93/shelf-lib-js/downloads","issues_url":"https://api.github.com/repos/lnagle93/shelf-lib-js/issues{/number}","pulls_url":"https://api.github.com/repos/lnagle93/shelf-lib-js/pulls{/number}","milestones_url":"https://api.github.com/repos/lnagle93/shelf-lib-js/milestones{/number}","notifications_url":"https://api.github.com/repos/lnagle93/shelf-lib-js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lnagle93/shelf-lib-js/labels{/name}","releases_url":"https://api.github.com/repos/lnagle93/shelf-lib-js/releases{/id}","deployments_url":"https://api.github.com/repos/lnagle93/shelf-lib-js/deployments","created_at":"2016-10-26T13:20:19Z","updated_at":"2016-10-13T13:20:09Z","pushed_at":"2016-12-01T17:10:56Z","git_url":"git://github.com/lnagle93/shelf-lib-js.git","ssh_url":"git@github.com:lnagle93/shelf-lib-js.git","clone_url":"https://github.com/lnagle93/shelf-lib-js.git","svn_url":"https://github.com/lnagle93/shelf-lib-js","homepage":null,"size":74,"stargazers_count":0,"watchers_count":0,"language":null,"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":"not-nexus:master","ref":"master","sha":"edb4edab7204de0b4ce7234181f18ca7f75d80bb","user":{"login":"not-nexus","id":23244957,"avatar_url":"https://avatars.githubusercontent.com/u/23244957?v=3","gravatar_id":"","url":"https://api.github.com/users/not-nexus","html_url":"https://github.com/not-nexus","followers_url":"https://api.github.com/users/not-nexus/followers","following_url":"https://api.github.com/users/not-nexus/following{/other_user}","gists_url":"https://api.github.com/users/not-nexus/gists{/gist_id}","starred_url":"https://api.github.com/users/not-nexus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/not-nexus/subscriptions","organizations_url":"https://api.github.com/users/not-nexus/orgs","repos_url":"https://api.github.com/users/not-nexus/repos","events_url":"https://api.github.com/users/not-nexus/events{/privacy}","received_events_url":"https://api.github.com/users/not-nexus/received_events","type":"Organization","site_admin":false},"repo":{"id":70175423,"name":"shelf-lib-js","full_name":"not-nexus/shelf-lib-js","owner":{"login":"not-nexus","id":23244957,"avatar_url":"https://avatars.githubusercontent.com/u/23244957?v=3","gravatar_id":"","url":"https://api.github.com/users/not-nexus","html_url":"https://github.com/not-nexus","followers_url":"https://api.github.com/users/not-nexus/followers","following_url":"https://api.github.com/users/not-nexus/following{/other_user}","gists_url":"https://api.github.com/users/not-nexus/gists{/gist_id}","starred_url":"https://api.github.com/users/not-nexus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/not-nexus/subscriptions","organizations_url":"https://api.github.com/users/not-nexus/orgs","repos_url":"https://api.github.com/users/not-nexus/repos","events_url":"https://api.github.com/users/not-nexus/events{/privacy}","received_events_url":"https://api.github.com/users/not-nexus/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/not-nexus/shelf-lib-js","description":null,"fork":false,"url":"https://api.github.com/repos/not-nexus/shelf-lib-js","forks_url":"https://api.github.com/repos/not-nexus/shelf-lib-js/forks","keys_url":"https://api.github.com/repos/not-nexus/shelf-lib-js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/not-nexus/shelf-lib-js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/not-nexus/shelf-lib-js/teams","hooks_url":"https://api.github.com/repos/not-nexus/shelf-lib-js/hooks","issue_events_url":"https://api.github.com/repos/not-nexus/shelf-lib-js/issues/events{/number}","events_url":"https://api.github.com/repos/not-nexus/shelf-lib-js/events","assignees_url":"https://api.github.com/repos/not-nexus/shelf-lib-js/assignees{/user}","branches_url":"https://api.github.com/repos/not-nexus/shelf-lib-js/branches{/branch}","tags_url":"https://api.github.com/repos/not-nexus/shelf-lib-js/tags","blobs_url":"https://api.github.com/repos/not-nexus/shelf-lib-js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/not-nexus/shelf-lib-js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/not-nexus/shelf-lib-js/git/refs{/sha}","trees_url":"https://api.github.com/repos/not-nexus/shelf-lib-js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/not-nexus/shelf-lib-js/statuses/{sha}","languages_url":"https://api.github.com/repos/not-nexus/shelf-lib-js/languages","stargazers_url":"https://api.github.com/repos/not-nexus/shelf-lib-js/stargazers","contributors_url":"https://api.github.com/repos/not-nexus/shelf-lib-js/contributors","subscribers_url":"https://api.github.com/repos/not-nexus/shelf-lib-js/subscribers","subscription_url":"https://api.github.com/repos/not-nexus/shelf-lib-js/subscription","commits_url":"https://api.github.com/repos/not-nexus/shelf-lib-js/commits{/sha}","git_commits_url":"https://api.github.com/repos/not-nexus/shelf-lib-js/git/commits{/sha}","comments_url":"https://api.github.com/repos/not-nexus/shelf-lib-js/comments{/number}","issue_comment_url":"https://api.github.com/repos/not-nexus/shelf-lib-js/issues/comments{/number}","contents_url":"https://api.github.com/repos/not-nexus/shelf-lib-js/contents/{+path}","compare_url":"https://api.github.com/repos/not-nexus/shelf-lib-js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/not-nexus/shelf-lib-js/merges","archive_url":"https://api.github.com/repos/not-nexus/shelf-lib-js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/not-nexus/shelf-lib-js/downloads","issues_url":"https://api.github.com/repos/not-nexus/shelf-lib-js/issues{/number}","pulls_url":"https://api.github.com/repos/not-nexus/shelf-lib-js/pulls{/number}","milestones_url":"https://api.github.com/repos/not-nexus/shelf-lib-js/milestones{/number}","notifications_url":"https://api.github.com/repos/not-nexus/shelf-lib-js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/not-nexus/shelf-lib-js/labels{/name}","releases_url":"https://api.github.com/repos/not-nexus/shelf-lib-js/releases{/id}","deployments_url":"https://api.github.com/repos/not-nexus/shelf-lib-js/deployments","created_at":"2016-10-06T17:13:01Z","updated_at":"2016-11-10T17:37:03Z","pushed_at":"2016-12-02T15:32:52Z","git_url":"git://github.com/not-nexus/shelf-lib-js.git","ssh_url":"git@github.com:not-nexus/shelf-lib-js.git","clone_url":"https://github.com/not-nexus/shelf-lib-js.git","svn_url":"https://github.com/not-nexus/shelf-lib-js","homepage":null,"size":124,"stargazers_count":1,"watchers_count":1,"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":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/not-nexus/shelf-lib-js/pulls/7"},"html":{"href":"https://github.com/not-nexus/shelf-lib-js/pull/7"},"issue":{"href":"https://api.github.com/repos/not-nexus/shelf-lib-js/issues/7"},"comments":{"href":"https://api.github.com/repos/not-nexus/shelf-lib-js/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/not-nexus/shelf-lib-js/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/not-nexus/shelf-lib-js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/not-nexus/shelf-lib-js/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/not-nexus/shelf-lib-js/statuses/3cbb53e8fbe58d236bbaeb346c720c7003575d1a"}}}}
{"actor":{"display_login":"kyle-long"}}