{"action":"created","comment":{"url":"https://api.github.com/repos/cvan/socketpeer/pulls/comments/26714910","id":26714910,"diff_hunk":"@@ -0,0 +1,139 @@\n+var SocketPeer = require('../server');\n+var test = require('tape');\n+\n+\n+test('connect_attempt event gets emitted', function (t) {\n+\n+  var peer = new SocketPeer({\n+    pairCode: 'yolo',\n+    url: 'http://localhost:3000'\n+  });\n+\n+  peer.on('connect_attempt', function () {\n+    t.pass('got connect_attempt event');\n+    t.equal(peer.socketConnected, false);\n+    t.equal(peer._connections.socket.attempt, 1);\n+    t.equal(peer._connections.socket.success, 0);\n+    t.equal(peer._connections.socket.error, 0);\n+    peer.destroy();","path":"test/index.js","position":null,"original_position":18,"commit_id":"3001c6423198da0b6377825b6fdba72b47309356","original_commit_id":"ec479534bb6a431badf9c05df32e4140426629ed","user":{"login":"cvan","id":203725,"avatar_url":"https://avatars.githubusercontent.com/u/203725?v=3","gravatar_id":"","url":"https://api.github.com/users/cvan","html_url":"https://github.com/cvan","followers_url":"https://api.github.com/users/cvan/followers","following_url":"https://api.github.com/users/cvan/following{/other_user}","gists_url":"https://api.github.com/users/cvan/gists{/gist_id}","starred_url":"https://api.github.com/users/cvan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cvan/subscriptions","organizations_url":"https://api.github.com/users/cvan/orgs","repos_url":"https://api.github.com/users/cvan/repos","events_url":"https://api.github.com/users/cvan/events{/privacy}","received_events_url":"https://api.github.com/users/cvan/received_events","type":"User","site_admin":false},"body":"I see this JS error:\r\n\r\n> Uncaught TypeError: Uncaught, unspecified \"error\" event.events.js:61 EventEmitter.emitindex.js:9 SocketPeer._socketErrorindex.js:9 SocketPeer.closeindex.js:9 SocketPeer.destroyindex.js:18 (anonymous function)events.js:74 EventEmitter.emitindex.js:9 SocketPeer.connectindex.js:9 (anonymous function)","created_at":"2015-03-18T22:37:07Z","updated_at":"2015-03-18T22:37:07Z","html_url":"https://github.com/cvan/socketpeer/pull/15#discussion_r26714910","pull_request_url":"https://api.github.com/repos/cvan/socketpeer/pulls/15","_links":{"self":{"href":"https://api.github.com/repos/cvan/socketpeer/pulls/comments/26714910"},"html":{"href":"https://github.com/cvan/socketpeer/pull/15#discussion_r26714910"},"pull_request":{"href":"https://api.github.com/repos/cvan/socketpeer/pulls/15"}}},"pull_request":{"url":"https://api.github.com/repos/cvan/socketpeer/pulls/15","id":31479385,"html_url":"https://github.com/cvan/socketpeer/pull/15","diff_url":"https://github.com/cvan/socketpeer/pull/15.diff","patch_url":"https://github.com/cvan/socketpeer/pull/15.patch","issue_url":"https://api.github.com/repos/cvan/socketpeer/issues/15","number":15,"state":"open","locked":false,"title":"add functional tests","user":{"login":"cvan","id":203725,"avatar_url":"https://avatars.githubusercontent.com/u/203725?v=3","gravatar_id":"","url":"https://api.github.com/users/cvan","html_url":"https://github.com/cvan","followers_url":"https://api.github.com/users/cvan/followers","following_url":"https://api.github.com/users/cvan/following{/other_user}","gists_url":"https://api.github.com/users/cvan/gists{/gist_id}","starred_url":"https://api.github.com/users/cvan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cvan/subscriptions","organizations_url":"https://api.github.com/users/cvan/orgs","repos_url":"https://api.github.com/users/cvan/repos","events_url":"https://api.github.com/users/cvan/events{/privacy}","received_events_url":"https://api.github.com/users/cvan/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-03-18T22:33:26Z","updated_at":"2015-03-18T22:37:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bf2fa8f120b24b3f07da64aa4cb7294db9c927b0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/cvan/socketpeer/pulls/15/commits","review_comments_url":"https://api.github.com/repos/cvan/socketpeer/pulls/15/comments","review_comment_url":"https://api.github.com/repos/cvan/socketpeer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cvan/socketpeer/issues/15/comments","statuses_url":"https://api.github.com/repos/cvan/socketpeer/statuses/3001c6423198da0b6377825b6fdba72b47309356","head":{"label":"cvan:tests","ref":"tests","sha":"3001c6423198da0b6377825b6fdba72b47309356","user":{"login":"cvan","id":203725,"avatar_url":"https://avatars.githubusercontent.com/u/203725?v=3","gravatar_id":"","url":"https://api.github.com/users/cvan","html_url":"https://github.com/cvan","followers_url":"https://api.github.com/users/cvan/followers","following_url":"https://api.github.com/users/cvan/following{/other_user}","gists_url":"https://api.github.com/users/cvan/gists{/gist_id}","starred_url":"https://api.github.com/users/cvan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cvan/subscriptions","organizations_url":"https://api.github.com/users/cvan/orgs","repos_url":"https://api.github.com/users/cvan/repos","events_url":"https://api.github.com/users/cvan/events{/privacy}","received_events_url":"https://api.github.com/users/cvan/received_events","type":"User","site_admin":false},"repo":{"id":31985780,"name":"socketpeer","full_name":"cvan/socketpeer","owner":{"login":"cvan","id":203725,"avatar_url":"https://avatars.githubusercontent.com/u/203725?v=3","gravatar_id":"","url":"https://api.github.com/users/cvan","html_url":"https://github.com/cvan","followers_url":"https://api.github.com/users/cvan/followers","following_url":"https://api.github.com/users/cvan/following{/other_user}","gists_url":"https://api.github.com/users/cvan/gists{/gist_id}","starred_url":"https://api.github.com/users/cvan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cvan/subscriptions","organizations_url":"https://api.github.com/users/cvan/orgs","repos_url":"https://api.github.com/users/cvan/repos","events_url":"https://api.github.com/users/cvan/events{/privacy}","received_events_url":"https://api.github.com/users/cvan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cvan/socketpeer","description":"simple messaging via WebRTC Data Channels and WebSockets","fork":false,"url":"https://api.github.com/repos/cvan/socketpeer","forks_url":"https://api.github.com/repos/cvan/socketpeer/forks","keys_url":"https://api.github.com/repos/cvan/socketpeer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cvan/socketpeer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cvan/socketpeer/teams","hooks_url":"https://api.github.com/repos/cvan/socketpeer/hooks","issue_events_url":"https://api.github.com/repos/cvan/socketpeer/issues/events{/number}","events_url":"https://api.github.com/repos/cvan/socketpeer/events","assignees_url":"https://api.github.com/repos/cvan/socketpeer/assignees{/user}","branches_url":"https://api.github.com/repos/cvan/socketpeer/branches{/branch}","tags_url":"https://api.github.com/repos/cvan/socketpeer/tags","blobs_url":"https://api.github.com/repos/cvan/socketpeer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cvan/socketpeer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cvan/socketpeer/git/refs{/sha}","trees_url":"https://api.github.com/repos/cvan/socketpeer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cvan/socketpeer/statuses/{sha}","languages_url":"https://api.github.com/repos/cvan/socketpeer/languages","stargazers_url":"https://api.github.com/repos/cvan/socketpeer/stargazers","contributors_url":"https://api.github.com/repos/cvan/socketpeer/contributors","subscribers_url":"https://api.github.com/repos/cvan/socketpeer/subscribers","subscription_url":"https://api.github.com/repos/cvan/socketpeer/subscription","commits_url":"https://api.github.com/repos/cvan/socketpeer/commits{/sha}","git_commits_url":"https://api.github.com/repos/cvan/socketpeer/git/commits{/sha}","comments_url":"https://api.github.com/repos/cvan/socketpeer/comments{/number}","issue_comment_url":"https://api.github.com/repos/cvan/socketpeer/issues/comments{/number}","contents_url":"https://api.github.com/repos/cvan/socketpeer/contents/{+path}","compare_url":"https://api.github.com/repos/cvan/socketpeer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cvan/socketpeer/merges","archive_url":"https://api.github.com/repos/cvan/socketpeer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cvan/socketpeer/downloads","issues_url":"https://api.github.com/repos/cvan/socketpeer/issues{/number}","pulls_url":"https://api.github.com/repos/cvan/socketpeer/pulls{/number}","milestones_url":"https://api.github.com/repos/cvan/socketpeer/milestones{/number}","notifications_url":"https://api.github.com/repos/cvan/socketpeer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cvan/socketpeer/labels{/name}","releases_url":"https://api.github.com/repos/cvan/socketpeer/releases{/id}","created_at":"2015-03-10T22:42:04Z","updated_at":"2015-03-16T23:10:00Z","pushed_at":"2015-03-18T22:36:48Z","git_url":"git://github.com/cvan/socketpeer.git","ssh_url":"git@github.com:cvan/socketpeer.git","clone_url":"https://github.com/cvan/socketpeer.git","svn_url":"https://github.com/cvan/socketpeer","homepage":null,"size":300,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":11,"forks":1,"open_issues":11,"watchers":0,"default_branch":"master"}},"base":{"label":"cvan:master","ref":"master","sha":"3bf7ba735f1480e8bfa5a23e39c5e9cfb8348df0","user":{"login":"cvan","id":203725,"avatar_url":"https://avatars.githubusercontent.com/u/203725?v=3","gravatar_id":"","url":"https://api.github.com/users/cvan","html_url":"https://github.com/cvan","followers_url":"https://api.github.com/users/cvan/followers","following_url":"https://api.github.com/users/cvan/following{/other_user}","gists_url":"https://api.github.com/users/cvan/gists{/gist_id}","starred_url":"https://api.github.com/users/cvan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cvan/subscriptions","organizations_url":"https://api.github.com/users/cvan/orgs","repos_url":"https://api.github.com/users/cvan/repos","events_url":"https://api.github.com/users/cvan/events{/privacy}","received_events_url":"https://api.github.com/users/cvan/received_events","type":"User","site_admin":false},"repo":{"id":31985780,"name":"socketpeer","full_name":"cvan/socketpeer","owner":{"login":"cvan","id":203725,"avatar_url":"https://avatars.githubusercontent.com/u/203725?v=3","gravatar_id":"","url":"https://api.github.com/users/cvan","html_url":"https://github.com/cvan","followers_url":"https://api.github.com/users/cvan/followers","following_url":"https://api.github.com/users/cvan/following{/other_user}","gists_url":"https://api.github.com/users/cvan/gists{/gist_id}","starred_url":"https://api.github.com/users/cvan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cvan/subscriptions","organizations_url":"https://api.github.com/users/cvan/orgs","repos_url":"https://api.github.com/users/cvan/repos","events_url":"https://api.github.com/users/cvan/events{/privacy}","received_events_url":"https://api.github.com/users/cvan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cvan/socketpeer","description":"simple messaging via WebRTC Data Channels and WebSockets","fork":false,"url":"https://api.github.com/repos/cvan/socketpeer","forks_url":"https://api.github.com/repos/cvan/socketpeer/forks","keys_url":"https://api.github.com/repos/cvan/socketpeer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cvan/socketpeer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cvan/socketpeer/teams","hooks_url":"https://api.github.com/repos/cvan/socketpeer/hooks","issue_events_url":"https://api.github.com/repos/cvan/socketpeer/issues/events{/number}","events_url":"https://api.github.com/repos/cvan/socketpeer/events","assignees_url":"https://api.github.com/repos/cvan/socketpeer/assignees{/user}","branches_url":"https://api.github.com/repos/cvan/socketpeer/branches{/branch}","tags_url":"https://api.github.com/repos/cvan/socketpeer/tags","blobs_url":"https://api.github.com/repos/cvan/socketpeer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cvan/socketpeer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cvan/socketpeer/git/refs{/sha}","trees_url":"https://api.github.com/repos/cvan/socketpeer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cvan/socketpeer/statuses/{sha}","languages_url":"https://api.github.com/repos/cvan/socketpeer/languages","stargazers_url":"https://api.github.com/repos/cvan/socketpeer/stargazers","contributors_url":"https://api.github.com/repos/cvan/socketpeer/contributors","subscribers_url":"https://api.github.com/repos/cvan/socketpeer/subscribers","subscription_url":"https://api.github.com/repos/cvan/socketpeer/subscription","commits_url":"https://api.github.com/repos/cvan/socketpeer/commits{/sha}","git_commits_url":"https://api.github.com/repos/cvan/socketpeer/git/commits{/sha}","comments_url":"https://api.github.com/repos/cvan/socketpeer/comments{/number}","issue_comment_url":"https://api.github.com/repos/cvan/socketpeer/issues/comments{/number}","contents_url":"https://api.github.com/repos/cvan/socketpeer/contents/{+path}","compare_url":"https://api.github.com/repos/cvan/socketpeer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cvan/socketpeer/merges","archive_url":"https://api.github.com/repos/cvan/socketpeer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cvan/socketpeer/downloads","issues_url":"https://api.github.com/repos/cvan/socketpeer/issues{/number}","pulls_url":"https://api.github.com/repos/cvan/socketpeer/pulls{/number}","milestones_url":"https://api.github.com/repos/cvan/socketpeer/milestones{/number}","notifications_url":"https://api.github.com/repos/cvan/socketpeer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cvan/socketpeer/labels{/name}","releases_url":"https://api.github.com/repos/cvan/socketpeer/releases{/id}","created_at":"2015-03-10T22:42:04Z","updated_at":"2015-03-16T23:10:00Z","pushed_at":"2015-03-18T22:36:48Z","git_url":"git://github.com/cvan/socketpeer.git","ssh_url":"git@github.com:cvan/socketpeer.git","clone_url":"https://github.com/cvan/socketpeer.git","svn_url":"https://github.com/cvan/socketpeer","homepage":null,"size":300,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":11,"forks":1,"open_issues":11,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cvan/socketpeer/pulls/15"},"html":{"href":"https://github.com/cvan/socketpeer/pull/15"},"issue":{"href":"https://api.github.com/repos/cvan/socketpeer/issues/15"},"comments":{"href":"https://api.github.com/repos/cvan/socketpeer/issues/15/comments"},"review_comments":{"href":"https://api.github.com/repos/cvan/socketpeer/pulls/15/comments"},"review_comment":{"href":"https://api.github.com/repos/cvan/socketpeer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cvan/socketpeer/pulls/15/commits"},"statuses":{"href":"https://api.github.com/repos/cvan/socketpeer/statuses/3001c6423198da0b6377825b6fdba72b47309356"}}}}