I am writing a spectron test to verify if all the processes are closed with app exit. Here is a copy of my code.
const pid = app.mainProcess; await app.stop()