Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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');
});
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');
});
Consul.walk = Consul.prototype.walk = function() {
return papi.tools.walk(Consul);
};
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;
}
}
Jenkins.walk = Jenkins.prototype.walk = function() {
return papi.tools.walk(Jenkins);
};
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;
}
}