{"action":"opened","issue":{"url":"https://api.github.com/repos/cgiffard/node-simplecrawler/issues/210","repository_url":"https://api.github.com/repos/cgiffard/node-simplecrawler","labels_url":"https://api.github.com/repos/cgiffard/node-simplecrawler/issues/210/labels{/name}","comments_url":"https://api.github.com/repos/cgiffard/node-simplecrawler/issues/210/comments","events_url":"https://api.github.com/repos/cgiffard/node-simplecrawler/issues/210/events","html_url":"https://github.com/cgiffard/node-simplecrawler/issues/210","id":131022723,"number":210,"title":"Doesn't work with nock ?","user":{"login":"rlanore","id":1931678,"avatar_url":"https://avatars.githubusercontent.com/u/1931678?v=3","gravatar_id":"","url":"https://api.github.com/users/rlanore","html_url":"https://github.com/rlanore","followers_url":"https://api.github.com/users/rlanore/followers","following_url":"https://api.github.com/users/rlanore/following{/other_user}","gists_url":"https://api.github.com/users/rlanore/gists{/gist_id}","starred_url":"https://api.github.com/users/rlanore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rlanore/subscriptions","organizations_url":"https://api.github.com/users/rlanore/orgs","repos_url":"https://api.github.com/users/rlanore/repos","events_url":"https://api.github.com/users/rlanore/events{/privacy}","received_events_url":"https://api.github.com/users/rlanore/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-03T13:19:29Z","updated_at":"2016-02-03T13:19:29Z","closed_at":null,"body":"I'm trying to use this module with nock for testing a small app but it doesn't fire fetchcomplete event and hang on fetchheaders\r\n\r\n```js\r\n(function () {\r\n    'use strict' ;\r\n    var fs = require('fs'),\r\n       nock = require('nock'),\r\n       Crawler = require('simplecrawler');\r\n\r\n    var scope = nock('http://test.nock')\r\n        .get('/testNock')\r\n        //.reply(404);\r\n        .reply(200, 'Hello from Google!');\r\n    var crawler = new Crawler('test.nock');\r\n    crawler.initialPath = '/testNock',\r\n    crawler.initialPort = 80,\r\n    crawler.initialProtocol = 'http';\r\n    crawler.maxDepth = 2;\r\n    crawler.fetchWhitelistedMimeTypesBelowMaxDepth = true;\r\n    crawler.maxConcurrency = 1;\r\n\r\n    crawler.on(\"fetchcomplete\", function(queueItem, responseBuffer, response) {\r\n        console.log('fecthcomplete');\r\n    });\r\n    crawler.on(\"complete\", function() {\r\n        console.log('complete');\r\n    });\r\n    crawler.on(\"fetcherror\", function(queueItem, response) {\r\n        console.log('fetcherror');\r\n    });\r\n    crawler.on(\"gziperror\", function() {\r\n        console.log('gziperror');\r\n    });\r\n    crawler.on(\"fetch404\", function(queueItem, response) {\r\n        console.log('fetch404');\r\n    });\r\n    crawler.on(\"fetchredirect\", function(queueItem, parsedURL, response) {\r\n        console.log('fetchredirect');\r\n    });\r\n    crawler.on(\"fetchdataerror\", function(queueItem, response) {\r\n        console.log('fetchdataerror');\r\n    });\r\n    crawler.on(\"fetchclienterror\", function(queueItem, errorData) {\r\n        console.log('fetchclienterror');\r\n        console.log('Error: '+errorData);\r\n    });\r\n    crawler.on(\"fetchtimeout\", function(queueItem,timeout) {\r\n        console.log('fetchtimeout'+timeout);\r\n    });\r\n    crawler.on(\"fetchstart\", function() {\r\n        console.log('start');\r\n    });\r\n    crawler.on(\"fetchheaders\", function(queueItem, responseObject) {\r\n        console.log(JSON.stringify(queueItem));\r\n        console.log('fetchheaders');\r\n    });\r\n    crawler.on(\"queueerror\", function() {\r\n        console.log('queueerror');\r\n    });\r\n    crawler.on(\"queueadd\", function() {\r\n        console.log('queueadd');\r\n    });\r\n    crawler.on(\"discoverycomplete\", function(queueItem, resources) {\r\n        console.log('discoverycomplete');\r\n    });\r\n    crawler.on(\"notmodified\", function(queueItem, resources) {\r\n        console.log('notmodified');\r\n    });\r\n\r\n   crawler.start();\r\n    console.log('do finish');\r\n}());\r\n\r\n```"}}