{"action":"created","issue":{"url":"https://api.github.com/repos/gotwarlost/mock-spawn/issues/4","labels_url":"https://api.github.com/repos/gotwarlost/mock-spawn/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/gotwarlost/mock-spawn/issues/4/comments","events_url":"https://api.github.com/repos/gotwarlost/mock-spawn/issues/4/events","html_url":"https://github.com/gotwarlost/mock-spawn/issues/4","id":54995930,"number":4,"title":"doesn't emit close event","user":{"login":"klepthys","id":4112885,"avatar_url":"https://avatars.githubusercontent.com/u/4112885?v=3","gravatar_id":"","url":"https://api.github.com/users/klepthys","html_url":"https://github.com/klepthys","followers_url":"https://api.github.com/users/klepthys/followers","following_url":"https://api.github.com/users/klepthys/following{/other_user}","gists_url":"https://api.github.com/users/klepthys/gists{/gist_id}","starred_url":"https://api.github.com/users/klepthys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/klepthys/subscriptions","organizations_url":"https://api.github.com/users/klepthys/orgs","repos_url":"https://api.github.com/users/klepthys/repos","events_url":"https://api.github.com/users/klepthys/events{/privacy}","received_events_url":"https://api.github.com/users/klepthys/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-01-21T09:31:59Z","updated_at":"2015-06-02T05:45:38Z","closed_at":null,"body":"simple use case, in node : \r\n\r\n    var spawn = require('child_process').spawn;\r\n    child=spawn(\"cmd\");\r\n    child.on(\"close\",function(){\r\n      console.log('close')\r\n    });\r\n    child.on(\"error\",function(){\r\n      console.log(\"error\");\r\n    });\r\n\r\nI get output: \r\n\r\n    error\r\n    close\r\n\r\nNow, when I do : \r\n    \r\n    var mock = require(\"mock-spawn\");   \r\n    var spawn = mock();\r\n    spawn.setDefault(mspawn.simple(127));\r\n    /** same code as before**/\r\n\r\n\"close\" event doesn't get called.\r\nMy workaround is to specifically call ```emit(\"close\",exit_code);```. Is this normal for some reason to have to do this?\r\n    \r\n"},"comment":{"url":"https://api.github.com/repos/gotwarlost/mock-spawn/issues/comments/107814815","html_url":"https://github.com/gotwarlost/mock-spawn/issues/4#issuecomment-107814815","issue_url":"https://api.github.com/repos/gotwarlost/mock-spawn/issues/4","id":107814815,"user":{"login":"xiphiaz","id":721513,"avatar_url":"https://avatars.githubusercontent.com/u/721513?v=3","gravatar_id":"","url":"https://api.github.com/users/xiphiaz","html_url":"https://github.com/xiphiaz","followers_url":"https://api.github.com/users/xiphiaz/followers","following_url":"https://api.github.com/users/xiphiaz/following{/other_user}","gists_url":"https://api.github.com/users/xiphiaz/gists{/gist_id}","starred_url":"https://api.github.com/users/xiphiaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xiphiaz/subscriptions","organizations_url":"https://api.github.com/users/xiphiaz/orgs","repos_url":"https://api.github.com/users/xiphiaz/repos","events_url":"https://api.github.com/users/xiphiaz/events{/privacy}","received_events_url":"https://api.github.com/users/xiphiaz/received_events","type":"User","site_admin":false},"created_at":"2015-06-02T05:45:38Z","updated_at":"2015-06-02T05:45:38Z","body":":+1: reverting to 0.2.1 fixes the emitting of close event"}}