function createCustomPlan(factory) {
      return function () {
        const plan = factory.apply(null, arguments);

        if (!j$.isFunction_(plan)) {
          throw new Error('Spy strategy must return a function');
        }

        this.plan = plan;
        return this.getSpy();
      };
    }
Tell the spy to return a promise rejecting with the specified value when invoked.
@name SpyStrategy#rejectWith
@since 3.5.0
@function
@param {*} value The value to return.