docs: function initDelayMock() {
    const pendingPromises = [];
  
    return Promise.resolve({
      service: {
        create,
        clear,
        __resolve,
        __resolveAll,
        __reject,
        __rejectAll,
      },
    });
  
    function create() {
      let _resolve;
      let _reject;
      const promise = new Promise((resolve, reject) => {
        _reject = reject;
        _resolve = resolve;
      });
  
      pendingPromises.push({
        promise,
        resolve: _resolve,
        reject: _reject,
      });
      return promise;
    }
  
    function clear(promise) {
      const pendingPromiseIndex = pendingPromises.findIndex(
        pendingPromise => pendingPromise.promise === promise,
      );
  
      if (-1 === pendingPromiseIndex) {
        return Promise.reject(new YError('E_BAD_DELAY'));
      }
      pendingPromises[pendingPromiseIndex].reject(new YError('E_DELAY_CLEARED'));
      pendingPromises.splice(pendingPromiseIndex, 1);
      return Promise.resolve();
    }
  
    function __resolve(promise) {
      const pendingPromise = pendingPromises.find(
        pendingPromise => pendingPromise.promise === promise,
      );
  
      if (!pendingPromise) {
        return Promise.reject(new YError('E_BAD_DELAY'));
      }
      pendingPromise.resolve();
      return Promise.resolve().then(__delete.bind(null, promise));
    }
  
    function __resolveAll() {
      return Promise.all(
        pendingPromises.map(({ promise }) => __resolve(promise)),
      );
    }
  
    function __reject(promise) {
      const pendingPromise = pendingPromises.find(
        pendingPromise => pendingPromise.promise === promise,
      );
  
      if (!pendingPromise) {
        return Promise.reject(new YError('E_BAD_DELAY'));
      }
      pendingPromise.reject(new YError('E_DELAY_CLEARED'));
      return Promise.resolve().then(__delete.bind(null, promise));
    }
  
    function __rejectAll() {
      return Promise.all(pendingPromises.map(({ promise }) => __reject(promise)));
    }
  
    function __delete(promise) {
      const pendingPromiseIndex = pendingPromises.findIndex(
        pendingPromise => pendingPromise.promise === promise,
      );
      pendingPromises.splice(pendingPromiseIndex, 1);
    }
  }