docs: function _wait(eventName, timeout = 1000) {
      return new Promise((resolve, reject) => {
        let timeoutId = null;
  
        timeoutId = setTimeout(() => {
          timeoutId = null;
          reject(new Error(`event ${eventName} didn't occur after ${timeout}ms`));
        }, timeout);
  
        emitter.once(eventName, () => {
          if (timeoutId !== null) {
            clearTimeout(timeoutId);
            resolve();
          }
        });
      });
    }