code: function (fn, repeatTest = 0, args = []) {
      /**
       * if a new hook gets executed we can assume that all commands should have finised
       * with exception of timeouts where `commandIsRunning` will never be reset but here
       */
      // commandIsRunning = false
  
      return new Promise((resolve, reject) => {
          try {
              const res = fn.apply(this, args)
              resolve(res)
          } catch (e) {
              if (repeatTest) {
                  return resolve(executeSync(fn, --repeatTest, args))
              }
  
              /**
               * no need to modify stack if no stack available
               */
              if (!e.stack) {
                  return reject(e)
              }
  
              e.stack = e.stack.split('\n').filter(STACKTRACE_FILTER_FN).join('\n')
              reject(e)
          }
      })
  }
docs: execute test or hook synchronously
  @param  {Function} fn         spec or hook method
  @param  {Number}   repeatTest number of retries
  @return {Promise}             that gets resolved once test/hook is done or was retried enough