{"action":"created","issue":{"url":"https://api.github.com/repos/nock/nock/issues/596","repository_url":"https://api.github.com/repos/nock/nock","labels_url":"https://api.github.com/repos/nock/nock/issues/596/labels{/name}","comments_url":"https://api.github.com/repos/nock/nock/issues/596/comments","events_url":"https://api.github.com/repos/nock/nock/issues/596/events","html_url":"https://github.com/nock/nock/issues/596","id":161740490,"node_id":"MDU6SXNzdWUxNjE3NDA0OTA=","number":596,"title":"Nocked calls to nested HTTP calls not working as expected","user":{"login":"maheshjag","id":1705603,"node_id":"MDQ6VXNlcjE3MDU2MDM=","avatar_url":"https://avatars0.githubusercontent.com/u/1705603?v=4","gravatar_id":"","url":"https://api.github.com/users/maheshjag","html_url":"https://github.com/maheshjag","followers_url":"https://api.github.com/users/maheshjag/followers","following_url":"https://api.github.com/users/maheshjag/following{/other_user}","gists_url":"https://api.github.com/users/maheshjag/gists{/gist_id}","starred_url":"https://api.github.com/users/maheshjag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maheshjag/subscriptions","organizations_url":"https://api.github.com/users/maheshjag/orgs","repos_url":"https://api.github.com/users/maheshjag/repos","events_url":"https://api.github.com/users/maheshjag/events{/privacy}","received_events_url":"https://api.github.com/users/maheshjag/received_events","type":"User","site_admin":false},"labels":[{"id":1055761077,"node_id":"MDU6TGFiZWwxMDU1NzYxMDc3","url":"https://api.github.com/repos/nock/nock/labels/stale","name":"stale","color":"ffffff","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2016-06-22T17:27:07Z","updated_at":"2018-09-20T10:17:44Z","closed_at":"2018-09-20T10:17:44Z","author_association":"NONE","body":"Here's a sample app:\n\n```\nvar express = require('express');\nvar cookieParser = require('cookie-parser');\nvar bodyParser = require('body-parser');\nvar request = require('request');\n\nvar app = express();\nvar PORT = 1234;\napp.set('port', PORT);\napp.use(bodyParser.json());\napp.use(bodyParser.urlencoded({ extended: false }));\napp.use(cookieParser());\n\napp.get('/test', function (req, res) {\n    request.get('http://www.google.com', function (err, response, body) {\n        res.send(body);\n    });\n});\n\napp.listen(PORT, function () {\n    console.log('App started on port ' + PORT + '!');\n});\n```\n\nHere's the Mocha test for it:\n\n```\nvar mocker = require('nock');\nvar assert = require('chai').assert;\nvar request = require('request');\n\ndescribe('node-nock', function () {\n    var testOutput = 'Hooray!';\n    mocker('http://www.google.com')\n        .get('/')\n        .reply(200, testOutput);\n\n    it('should mock the request to google.com', function (done) {\n        request('http://localhost:1234/test', function (err, response, body) {\n            assert.equal(testOutput, body);\n            done();\n        });\n    });\n});\n```\n\nRunning the test above fails the assertion even though the call to www.google.com has been nocked.\n"},"comment":{"url":"https://api.github.com/repos/nock/nock/issues/comments/423128245","html_url":"https://github.com/nock/nock/issues/596#issuecomment-423128245","issue_url":"https://api.github.com/repos/nock/nock/issues/596","id":423128245,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMzEyODI0NQ==","user":{"login":"maheshjag","id":1705603,"node_id":"MDQ6VXNlcjE3MDU2MDM=","avatar_url":"https://avatars0.githubusercontent.com/u/1705603?v=4","gravatar_id":"","url":"https://api.github.com/users/maheshjag","html_url":"https://github.com/maheshjag","followers_url":"https://api.github.com/users/maheshjag/followers","following_url":"https://api.github.com/users/maheshjag/following{/other_user}","gists_url":"https://api.github.com/users/maheshjag/gists{/gist_id}","starred_url":"https://api.github.com/users/maheshjag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maheshjag/subscriptions","organizations_url":"https://api.github.com/users/maheshjag/orgs","repos_url":"https://api.github.com/users/maheshjag/repos","events_url":"https://api.github.com/users/maheshjag/events{/privacy}","received_events_url":"https://api.github.com/users/maheshjag/received_events","type":"User","site_admin":false},"created_at":"2018-09-20T10:17:44Z","updated_at":"2018-09-20T10:17:44Z","author_association":"NONE","body":"@vitorarins @matanh-tzmedical Many thanks for your responses. No, I wasn't requiring the app in my test, and yes, I was running the app separately.\r\n\r\nYes, I'm happy for this issue to be closed."}}
{"actor":{"display_login":"maheshjag"}}