How to use the papi.tools function in papi

To help you get started, we’ve selected a few papi examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github silas / node-consul / test / consul.js View on Github external
it('should prefix error message', function() {
      this.sinon.stub(papi.tools, 'promisify').callsFake(function() {
        throw new Error('test');
      });

      should(function() {
        helper.consul({ promisify: true });
      }).throw('promisify: test');
    });
github silas / node-jenkins / test / jenkins.js View on Github external
it('should prefix error message', function() {
      var self = this;

      self.sinon.stub(papi.tools, 'promisify').callsFake(function() {
        throw new Error('test');
      });

      should(function() {
        jenkins({ baseUrl: self.url, promisify: true });
      }).throw('promisify: test');
    });
github silas / node-consul / lib / consul.js View on Github external
Consul.walk = Consul.prototype.walk = function() {
  return papi.tools.walk(Consul);
};
github silas / node-jenkins / lib / jenkins.js View on Github external
this._ext('onResponse', this._onResponse);

  this.build = new Jenkins.Build(this);
  this.crumbIssuer = new Jenkins.CrumbIssuer(this);
  this.job = new Jenkins.Job(this);
  this.label = new Jenkins.Label(this);
  this.node = new Jenkins.Node(this);
  this.queue = new Jenkins.Queue(this);
  this.view = new Jenkins.View(this);

  try {
    if (opts.promisify) {
      if (typeof opts.promisify === 'function') {
        papi.tools.promisify(this, opts.promisify);
      } else {
        papi.tools.promisify(this);
      }
    }
  } catch (err) {
    err.message = 'promisify: ' + err.message;
    throw err;
  }
}
github silas / node-jenkins / lib / jenkins.js View on Github external
Jenkins.walk = Jenkins.prototype.walk = function() {
  return papi.tools.walk(Jenkins);
};
github silas / node-consul / lib / consul.js View on Github external
papi.Client.call(this, opts);

  this.acl = new Consul.Acl(this);
  this.agent = new Consul.Agent(this);
  this.catalog = new Consul.Catalog(this);
  this.event = new Consul.Event(this);
  this.health = new Consul.Health(this);
  this.kv = new Consul.Kv(this);
  this.query = new Consul.Query(this);
  this.session = new Consul.Session(this);
  this.status = new Consul.Status(this);

  try {
    if (opts.promisify) {
      if (typeof opts.promisify === 'function') {
        papi.tools.promisify(this, opts.promisify);
      } else {
        papi.tools.promisify(this);
      }
    }
  } catch (err) {
    err.message = 'promisify: ' + err.message;
    throw err;
  }
}