{"action":"created","issue":{"url":"https://api.github.com/repos/WhoopInc/supertest-as-promised/issues/33","repository_url":"https://api.github.com/repos/WhoopInc/supertest-as-promised","labels_url":"https://api.github.com/repos/WhoopInc/supertest-as-promised/issues/33/labels{/name}","comments_url":"https://api.github.com/repos/WhoopInc/supertest-as-promised/issues/33/comments","events_url":"https://api.github.com/repos/WhoopInc/supertest-as-promised/issues/33/events","html_url":"https://github.com/WhoopInc/supertest-as-promised/issues/33","id":168254130,"number":33,"title":"add request use functionality","user":{"login":"aqumus","id":10741508,"avatar_url":"https://avatars.githubusercontent.com/u/10741508?v=3","gravatar_id":"","url":"https://api.github.com/users/aqumus","html_url":"https://github.com/aqumus","followers_url":"https://api.github.com/users/aqumus/followers","following_url":"https://api.github.com/users/aqumus/following{/other_user}","gists_url":"https://api.github.com/users/aqumus/gists{/gist_id}","starred_url":"https://api.github.com/users/aqumus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aqumus/subscriptions","organizations_url":"https://api.github.com/users/aqumus/orgs","repos_url":"https://api.github.com/users/aqumus/repos","events_url":"https://api.github.com/users/aqumus/events{/privacy}","received_events_url":"https://api.github.com/users/aqumus/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-07-29T05:35:31Z","updated_at":"2016-07-30T15:52:55Z","closed_at":null,"body":"I was wondering whether we could add request use (middleware functions ) functionality ,which will attach  functions  to each request instead of explicitly attaching functions to every request .\r\nJust like https://github.com/koenpunt/superagent-use\r\n\r\nsupertest-as-promised + superagent-use under one hood ."},"comment":{"url":"https://api.github.com/repos/WhoopInc/supertest-as-promised/issues/comments/236372819","html_url":"https://github.com/WhoopInc/supertest-as-promised/issues/33#issuecomment-236372819","issue_url":"https://api.github.com/repos/WhoopInc/supertest-as-promised/issues/33","id":236372819,"user":{"login":"benesch","id":882976,"avatar_url":"https://avatars.githubusercontent.com/u/882976?v=3","gravatar_id":"","url":"https://api.github.com/users/benesch","html_url":"https://github.com/benesch","followers_url":"https://api.github.com/users/benesch/followers","following_url":"https://api.github.com/users/benesch/following{/other_user}","gists_url":"https://api.github.com/users/benesch/gists{/gist_id}","starred_url":"https://api.github.com/users/benesch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benesch/subscriptions","organizations_url":"https://api.github.com/users/benesch/orgs","repos_url":"https://api.github.com/users/benesch/repos","events_url":"https://api.github.com/users/benesch/events{/privacy}","received_events_url":"https://api.github.com/users/benesch/received_events","type":"User","site_admin":false},"created_at":"2016-07-30T15:52:55Z","updated_at":"2016-07-30T15:52:55Z","body":"I haven't tried this, but I believe you could use [superagent-defaults] to achieve what you want:\r\n\r\n```\r\nvar defaults = require('superagent-defaults');\r\n\r\nvar request = defaults(require('supertest-as-promised')(app));\r\n\r\nrequest\r\n  .get('/my-test-path')\r\n  .end(function(err, res) {\r\n    console.log(res.text);\r\n  });\r\n```\r\n\r\n[superagent-defaults]: https://github.com/camshaft/superagent-defaults"}}
{"actor":{"display_login":"benesch"}}