Q:

How to reset/restore to original spawn

I am trying to mock spawn process using mock-spawn module. The subsequent test are failing since I am not able to restore the mock.
I tried with mySpawn.resotre() but there is no such function. I checked the code still not able to figure it out.
Can anyone please help me on this.

A:

I had similar requirement, this is the comment from mock-spawn contributor

You can simply require('child_process').spawn if you need the original
  back. If you have overridden that, you should save the original before
  and reset the child_process spawn property to the saved original.

Ref: https://github.com/gotwarlost/mock-spawn/issues/13#issuecomment-342589086

