code: function killChrome() {
        helper.removeEventListeners(listeners);
        if (chromeProcess.pid && !chromeProcess.killed && !chromeClosed) {
          // Force kill chrome.
          try {
            if (process.platform === 'win32')
              childProcess.execSync(`taskkill /pid ${chromeProcess.pid} /T /F`);
            else
              process.kill(-chromeProcess.pid, 'SIGKILL');
          } catch (e) {
            // the process might have already stopped
          }
        }
        // Attempt to remove temporary profile directory to avoid littering.
        try {
          removeFolder.sync(temporaryUserDataDir);
        } catch (e) { }
      }
docs: This method has to be sync to be used as 'exit' event handler.