{"action":"created","issue":{"url":"https://api.github.com/repos/TooTallNate/superagent-proxy/issues/13","repository_url":"https://api.github.com/repos/TooTallNate/superagent-proxy","labels_url":"https://api.github.com/repos/TooTallNate/superagent-proxy/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/TooTallNate/superagent-proxy/issues/13/comments","events_url":"https://api.github.com/repos/TooTallNate/superagent-proxy/issues/13/events","html_url":"https://github.com/TooTallNate/superagent-proxy/issues/13","id":72905756,"number":13,"title":"Broken with supertest?","user":{"login":"MichaelJCole","id":1504790,"avatar_url":"https://avatars.githubusercontent.com/u/1504790?v=3","gravatar_id":"","url":"https://api.github.com/users/MichaelJCole","html_url":"https://github.com/MichaelJCole","followers_url":"https://api.github.com/users/MichaelJCole/followers","following_url":"https://api.github.com/users/MichaelJCole/following{/other_user}","gists_url":"https://api.github.com/users/MichaelJCole/gists{/gist_id}","starred_url":"https://api.github.com/users/MichaelJCole/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MichaelJCole/subscriptions","organizations_url":"https://api.github.com/users/MichaelJCole/orgs","repos_url":"https://api.github.com/users/MichaelJCole/repos","events_url":"https://api.github.com/users/MichaelJCole/events{/privacy}","received_events_url":"https://api.github.com/users/MichaelJCole/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-05-04T02:46:14Z","updated_at":"2016-03-08T06:21:54Z","closed_at":"2016-01-20T18:16:28Z","body":"```\r\nvar supertest = require('supertest');\r\nrequire('superagent-proxy')(supertest);    <-- Here\r\n```\r\nresults in:\r\n```\r\n/home/michael/scm/clustermeter/node_modules/superagent-proxy/index.js:97\r\n  if (desc.get == getUrl && desc.set == setUrl) return; // already patched\r\n          ^\r\nTypeError: Cannot read property 'get' of undefined\r\n    at setupUrl (/home/michael/scm/clustermeter/node_modules/superagent-proxy/index.js:97:11)\r\n    at Function.proxy (/home/michael/scm/clustermeter/node_modules/superagent-proxy/index.js:68:3)\r\n    at setup (/home/michael/scm/clustermeter/node_modules/superagent-proxy/index.js:50:18)\r\n    at Object.<anonymous> (/home/michael/scm/clustermeter/app.e2e.js:4:28)    <--- here\r\n    at Module._compile (module.js:460:26)\r\n```\r\nVersions installed:\r\n```\r\n├── superagent@0.21.0\r\n├── superagent-proxy@0.3.1\r\n└── supertest@0.15.0\r\n```\r\n\r\nIf I uninstall and reinstall, I get this:\r\n```\r\n npm --save install superagent superagent-proxy supertest\r\nnpm ERR! Linux 3.13.0-24-generic\r\nnpm ERR! argv \"node\" \"/home/michael/.nvm/versions/v0.12.0/bin/npm\" \"--save\" \"install\" \"superagent\" \"superagent-proxy\" \"supertest\"\r\nnpm ERR! node v0.12.0\r\nnpm ERR! npm  v2.6.0\r\nnpm ERR! code EPEERINVALID\r\n\r\nnpm ERR! peerinvalid The package superagent does not satisfy its siblings' peerDependencies requirements!\r\nnpm ERR! peerinvalid Peer superagent-proxy@0.3.1 wants superagent@>= 0.15.4 && < 1\r\n\r\nnpm ERR! Please include the following file with any support request:\r\nnpm ERR!     /home/michael/scm/clustermeter/npm-debug.log\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/TooTallNate/superagent-proxy/issues/comments/193624039","html_url":"https://github.com/TooTallNate/superagent-proxy/issues/13#issuecomment-193624039","issue_url":"https://api.github.com/repos/TooTallNate/superagent-proxy/issues/13","id":193624039,"user":{"login":"saimanoj01","id":5937425,"avatar_url":"https://avatars.githubusercontent.com/u/5937425?v=3","gravatar_id":"","url":"https://api.github.com/users/saimanoj01","html_url":"https://github.com/saimanoj01","followers_url":"https://api.github.com/users/saimanoj01/followers","following_url":"https://api.github.com/users/saimanoj01/following{/other_user}","gists_url":"https://api.github.com/users/saimanoj01/gists{/gist_id}","starred_url":"https://api.github.com/users/saimanoj01/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saimanoj01/subscriptions","organizations_url":"https://api.github.com/users/saimanoj01/orgs","repos_url":"https://api.github.com/users/saimanoj01/repos","events_url":"https://api.github.com/users/saimanoj01/events{/privacy}","received_events_url":"https://api.github.com/users/saimanoj01/received_events","type":"User","site_admin":false},"created_at":"2016-03-08T06:21:54Z","updated_at":"2016-03-08T06:21:54Z","body":"@jakubka \r\n`var request = require('supertest-as-promised');\r\nrequire('superagent-proxy')(request);`\r\n\r\nThe above code snippet was giving me an error too when using **supertest-as-promised**. I got it working in another way.\r\n\r\n`var proxy = require('superagent-proxy');\r\n var request =  require('supertest-as-promised')(_serverUri_);\r\n request = .request.get(_resource_);\r\n proxy(request, _proxyUri_);\r\n .\r\n .\r\n .\r\n .\r\n`\r\n\r\nYou can now use the **proxied** request object to make rest calls.\r\nHope this helps!"}}