How does one simulate a restart in package specs?


I need to write specs which involve restarting the running Atom session. I attempted this using atom.reload() and atom.restartApplication(), but both methods actually restarted the test-runner window itself, rather than the session it was simulating. Is there a way to achieve this gracefully?

Note: I’m using a custom test-runner, atom-mocha. Parameters for integrating with the test-runner API can be found here.