text: const utilIsEqual = require('lodash/isEqual');
  
  /**
   * Fake wrapper for functions
   *
   * @param {function} source - Source function
   * @param {Array.<Object>} declarations - Result declarations
   * @param   {Array} declarations.inputs - Source function arguments
   * @param   {*} declarations.output - Desired result
   *
   * @returns {function}
   */
  module.exports = function (source, declarations) {
      const i = (...args) => {
          if (i.restored) {
              source(...args);
          } else {
              findDeclaration.apply(declarations, args);
          }
      };
      i.restore = () => {
          i.restored = true;
      };
      i.replace = () => {
          delete i.restored;
      };
      return i;
  };
  
  function findDeclaration(...args) {
      const declaration = this.find((d) => utilIsEqual(d.inputs, args));
      if (declaration) {
          return declaration.output;
      } else {
          console.warn(`Undefined fake declaration: ${args.join(', ')}`);
      }
  }