docs: function automock (method) {
      // require function
      if (typeof method !== 'function') {
          throw new Error('automock error: automock must be called with function')
      }
      // create automock wrapper function
      var automockWrapper = function coreAutomockWrapper (args) {
          // require args to be object
          args = requireValidOptionalObject(args)
          // if the automock flag is set to false then call original method but
          // delete the automock flag from the session so that all subsequent
          // calls will be mocked
          if (args && args.session && args.session.automock === false) {
              // delete automock flag
              delete args.session.automock
              // call original method
              return method.apply(this, arguments)
          }
          // get stable id for args
          var stableId = moduleCallStableId({
              args: args,
              methodName: method.meta.methodName,
              moduleName: method.meta.moduleName,
          })
          // get mock data for moduleCall
          var moduleCallMock = immutableAutomock.moduleCallMocks[stableId]
          var moduleCallResolveMock = moduleCallMock && immutableAutomock.moduleCallResolveMocks[moduleCallMock.moduleCallId]
          // return mock data if moduleCall and ModuleCallResolve mocks exist
          if (moduleCallMock && moduleCallResolveMock) {
              // either resolve or reject - clone data to prevent mock pollution
              return moduleCallResolveMock.resolved
                  ? Promise.resolve(_.cloneDeep(moduleCallResolveMock.moduleCallResolveData))
                  : Promise.reject(_.cloneDeep(moduleCallResolveMock.moduleCallResolveData))
          }
          // if requireAutomock flag is set on session throw error
          else if (args && args.session && args.session.requireAutomock) {
              // create new error object
              var error = new Error('missing automock for method: '+method.meta.moduleName+'.'+method.meta.methodName)
              // add call data to error
              error.automockCallData = {
                  args: args,
                  methodName: method.meta.methodName,
                  moduleName: method.meta.moduleName,
              }
              error.automockStableId = stableId
              // throw error
              throw error
          }
          // call original method with args
          return method.apply(this, arguments)
      }
      // set method meta data on wrapper
      automockWrapper.meta = method.meta
      // return wrapper
      return automockWrapper
  }