TylorS / spawn-mock

Node.js child_process.spawn mock
MIT License
0 stars 0 forks source link

emit 'exit' on kill #1

Open kuceb opened 5 years ago

kuceb commented 5 years ago

I was using this to test execa, which listens to the exit and error events

Should the kill method also emit the exit event?

https://github.com/sindresorhus/execa/blob/v1.0.0/index.js#L239

TylorS commented 5 years ago

Hey @Bkucera thanks for the issue! From the looks of that code it would definitely seem like it should send out the exit event. I don't know if that's due to a change in node APIs or not - it's been a little while since I wrote this. I'd happily take a PR to add it in

call-a3 commented 4 years ago

I'm running into the same issue. I'll work around this for the time being by calling cp.emit('exit', 0, null) myself, but I intend to provide a PR for this in the near future.

TylorS commented 4 years ago

Hey @call-a3 thanks for letting us know of a workaround. Let me know if there's anything I can do to support you